lowdefy/lowdefy

View on GitHub

Showing 199 of 9,537 total issues

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

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

    const BrandTag = () => {
      const [showBranding, setShowBranding] = useState(false);
      useEffect(() => {
        checkEntitlement({ setShowBranding });
      }, []);
    Severity: Minor
    Found in packages/client/src/BrandTag.js - About 1 hr to fix

      Function reducer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Confirmed

      function reducer(state, action) {
        switch (action.type) {
          case 'increment':
            return {
              ...state,
      Severity: Minor
      Found in packages/client/src/ProgressBarController.js - About 1 hr to fix

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

        const hasValues = (val) => {
          switch (type.typeOf(val)) {
            case 'boolean':
            case 'date':
            case 'function':
        Severity: Minor
        Found in packages/utils/helpers/src/unset.js - About 1 hr to fix

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

          async function build(options) {
            const context = createContext(options);
            const components = await buildRefs({ context });
            testSchema({ components, context });
            buildApp({ components, context });
          Severity: Minor
          Found in packages/build/src/index.js - About 1 hr to fix

            Function fetch has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Confirmed

              async fetch(request) {
                request.loading = true;
                const startTime = Date.now();
            
                try {
            Severity: Minor
            Found in packages/engine/src/Requests.js - About 1 hr to fix

              Function wrappedHandler has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Function wrappedHandler has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function PaginationBlock has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const PaginationBlock = ({ blockId, loading, methods, properties, value }) => {
                    const [state, setState] = useState(() =>
                      calculateState({
                        defaultCurrent: 1,
                        defaultPageSize: properties.pageSizeOptions?.[0] ?? 10,

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

                  function _regex({ location, params, state }) {
                    const pattern = type.isObject(params) ? params.pattern : params;
                    if (!type.isString(pattern)) {
                      throw new Error(
                        `Operator Error: _regex.pattern must be a string. Received: ${JSON.stringify(

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

                  function _random({ location, params }) {
                    if (!type.isString(params) && !type.isObject(params)) {
                      throw new Error(
                        `Operator Error: _random takes an string or object type. Received: ${JSON.stringify(
                          params

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

                  const MultipleSelector = ({
                    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 _nunjucks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _nunjucks({ location, params, state, payload, runtime }) {
                    let templateString;
                    let on;
                    if (type.isObject(params) && type.isString(params.template)) {
                      templateString = params.template;

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

                  const dateFilter = (date, format, ...args) => {
                    // for no date, return undefined.
                    if (type.isNone(date)) {
                      return '';
                    }
                  Severity: Minor
                  Found in packages/utils/nunjucks/src/dateFilter.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 validateVersion has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  async function validateVersion({ cliVersion, lowdefyVersion, print, requiresLowdefyYaml }) {
                    if (!requiresLowdefyYaml) {
                      return;
                    }
                    if (lowdefyVersion === 'local') {
                  Severity: Minor
                  Found in packages/cli/src/utils/validateVersion.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 apiWrapper has 27 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-community/lib/server/apiWrapper.js - About 1 hr to fix

                    Function provideDocumentLinks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public async provideDocumentLinks(
                        document: vscode.TextDocument,
                        token: vscode.CancellationToken
                      ): Promise<vscode.DocumentLink[] | undefined> {
                        let links: vscode.DocumentLink[] = [];
                    Severity: Minor
                    Found in packages/ides/vscode/src/language/RefLinkProvider.ts - About 1 hr to fix

                      Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Confirmed

                        constructor({ arrayIndices = [], areas, context }) {
                          this.id = Math.random()
                            .toString(36)
                            .replace(/[^a-z]+/g, '')
                            .substring(0, 5);
                      Severity: Minor
                      Found in packages/engine/src/Blocks.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Confirmed

                            if (type.isObject(item)) {
                              let path = `${key}.${nextKey}[${index}]`;
                              // TODO: Convert all artifacts to not modify id.
                              const id =
                                item.blockId ??
                        Severity: Major
                        Found in packages/build/src/build/addKeys.js - About 1 hr to fix

                          Function getHue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const getHue = (hsv, i, isLight) => {
                            let hue;
                            if (hsv.h >= 60 && hsv.h <= 240) {
                              hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;
                            } else {
                          Severity: Minor
                          Found in packages/plugins/blocks/blocks-antd/src/color.js - About 55 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