lowdefy/lowdefy

View on GitHub

Showing 9,449 of 9,537 total issues

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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      try {
        return functions[methodName](...args);
      } catch (e) {
        throw new Error(
          `Operator Error: ${operator}.${methodName} - ${
    Severity: Major
    Found in packages/operators/src/runClass.js and 1 other location - About 1 hr to fix
    packages/operators/src/runInstance.js on lines 88..100

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      try {
        const result = instance[methodName](...args);
        if (meta[methodName].returnInstance) {
          return instance;
        }
    Severity: Major
    Found in packages/operators/src/runInstance.js and 1 other location - About 1 hr to fix
    packages/operators/src/runClass.js on lines 95..103

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    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 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 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 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-dev/lib/server/apiWrapper.js - About 1 hr to fix

                  Identical blocks of code found in 6 locations. Consider refactoring.
                  Open

                  const SwitchBlock = ({
                    blockId,
                    components: { Icon, Link },
                    events,
                    loading,
                  packages/plugins/blocks/blocks-antd/src/blocks/Slider/Slider.js on lines 24..73
                  packages/plugins/blocks/blocks-antd/src/blocks/PhoneNumberInput/PhoneNumberInput.js on lines 125..261
                  packages/plugins/blocks/blocks-antd/src/blocks/RatingSlider/RatingSlider.js on lines 72..237
                  packages/plugins/blocks/blocks-antd/src/blocks/Selector/Selector.js on lines 28..153
                  packages/plugins/blocks/blocks-antd/src/blocks/WeekSelector/WeekSelector.js on lines 28..87

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 6 locations. Consider refactoring.
                  Open

                  const WeekSelector = ({
                    blockId,
                    components: { Icon, Link },
                    events,
                    loading,
                  packages/plugins/blocks/blocks-antd/src/blocks/Slider/Slider.js on lines 24..73
                  packages/plugins/blocks/blocks-antd/src/blocks/PhoneNumberInput/PhoneNumberInput.js on lines 125..261
                  packages/plugins/blocks/blocks-antd/src/blocks/RatingSlider/RatingSlider.js on lines 72..237
                  packages/plugins/blocks/blocks-antd/src/blocks/Selector/Selector.js on lines 28..153
                  packages/plugins/blocks/blocks-antd/src/blocks/Switch/Switch.js on lines 24..102

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 59.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                    Identical blocks of code found in 6 locations. Consider refactoring.
                    Open

                    const RatingSlider = ({
                      blockId,
                      components: { Icon, Link },
                      events,
                      loading,
                    packages/plugins/blocks/blocks-antd/src/blocks/Slider/Slider.js on lines 24..73
                    packages/plugins/blocks/blocks-antd/src/blocks/PhoneNumberInput/PhoneNumberInput.js on lines 125..261
                    packages/plugins/blocks/blocks-antd/src/blocks/Selector/Selector.js on lines 28..153
                    packages/plugins/blocks/blocks-antd/src/blocks/Switch/Switch.js on lines 24..102
                    packages/plugins/blocks/blocks-antd/src/blocks/WeekSelector/WeekSelector.js on lines 28..87

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 59.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 6 locations. Consider refactoring.
                    Open

                    const Selector = ({
                      blockId,
                      components: { Icon, Link },
                      events,
                      loading,
                    packages/plugins/blocks/blocks-antd/src/blocks/Slider/Slider.js on lines 24..73
                    packages/plugins/blocks/blocks-antd/src/blocks/PhoneNumberInput/PhoneNumberInput.js on lines 125..261
                    packages/plugins/blocks/blocks-antd/src/blocks/RatingSlider/RatingSlider.js on lines 72..237
                    packages/plugins/blocks/blocks-antd/src/blocks/Switch/Switch.js on lines 24..102
                    packages/plugins/blocks/blocks-antd/src/blocks/WeekSelector/WeekSelector.js on lines 28..87

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 59.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 6 locations. Consider refactoring.
                    Open

                    const SliderBlock = ({
                      blockId,
                      components: { Icon, Link },
                      events,
                      loading,
                    packages/plugins/blocks/blocks-antd/src/blocks/PhoneNumberInput/PhoneNumberInput.js on lines 125..261
                    packages/plugins/blocks/blocks-antd/src/blocks/RatingSlider/RatingSlider.js on lines 72..237
                    packages/plugins/blocks/blocks-antd/src/blocks/Selector/Selector.js on lines 28..153
                    packages/plugins/blocks/blocks-antd/src/blocks/Switch/Switch.js on lines 24..102
                    packages/plugins/blocks/blocks-antd/src/blocks/WeekSelector/WeekSelector.js on lines 28..87

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 59.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                                            properties: {
                                              title: {
                                                type: 'string',
                                                description: 'Menu item title.',
                                              },
                    Severity: Major
                    Found in packages/utils/block-utils/src/blockSchema.js and 1 other location - About 1 hr to fix
                    packages/utils/block-utils/src/blockSchema.js on lines 173..187

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 59.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                                                    properties: {
                                                      title: {
                                                        type: 'string',
                                                        description: 'Menu item title.',
                                                      },
                    Severity: Major
                    Found in packages/utils/block-utils/src/blockSchema.js and 1 other location - About 1 hr to fix
                    packages/utils/block-utils/src/blockSchema.js on lines 132..146

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 59.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Function render has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render() {
                        const { div, id, methods, style } = this.props;
                        if (div === true) {
                          return (
                            <div
                    Severity: Minor
                    Found in packages/utils/block-utils/src/HtmlComponent.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language