rjrodger/gubu

View on GitHub
gubu.ts

Summary

Maintainability
C
1 day
Test Coverage

Function make has a Cognitive Complexity of 337 (exceeds 5 allowed). Consider refactoring.
Invalid

function make<S>(intop?: S | Node<S>, inopts?: GubuOptions) {
  const opts: GubuOptions = null == inopts ? {} : inopts

  // Ironically, we can't Gubu GubuOptions, so we have to set
  // option defaults manually.
Severity: Minor
Found in gubu.ts - About 6 days 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

File gubu.ts has 1950 lines of code (exceeds 250 allowed). Consider refactoring.
Invalid

/* Copyright (c) 2021-2023 Richard Rodger and other contributors, MIT License */

// FIX: does not work if Gubu is inside a Proxy - jest fails

// FEATURE: regexp in array: [/a/] => all elements must match /a/
Severity: Major
Found in gubu.ts - About 5 days to fix

    Function make has 364 lines of code (exceeds 25 allowed). Consider refactoring.
    Invalid

    function make<S>(intop?: S | Node<S>, inopts?: GubuOptions) {
      const opts: GubuOptions = null == inopts ? {} : inopts
    
      // Ironically, we can't Gubu GubuOptions, so we have to set
      // option defaults manually.
    Severity: Major
    Found in gubu.ts - About 1 day to fix

      Function exec has 290 lines of code (exceeds 25 allowed). Consider refactoring.
      Invalid

        function exec(
          root: any,
          ctx?: Context,
          match?: boolean // Suppress errors and return boolean result (true if match)
        ): any {
      Severity: Major
      Found in gubu.ts - About 1 day to fix

        Function makeErrImpl has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
        Invalid

        function makeErrImpl(
          why: string,
          s: State,
          mark: number,
          text?: string,
        Severity: Minor
        Found in gubu.ts - About 1 day 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 nodize has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
        Invalid

        function nodize<S>(shape?: any, depth?: number, meta?: NodeMeta): Node<S> {
        
          // If using builder as property of Gubu, `this` is just Gubu, not a node.
          if (make === shape) {
            shape = undefined
        Severity: Minor
        Found in gubu.ts - About 1 day 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 Rename has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
        Invalid

        const Rename = function <V>(this: any, inopts: any, shape?: Node<V> | V): Node<V> {
          let node = buildize(this, shape)
        
          let opts = S.object === typeof inopts ? inopts || {} : {}
          let name = S.string === typeof inopts ? inopts : opts.name
        Severity: Minor
        Found in gubu.ts - About 1 day 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 MakeArgu has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Invalid

        function MakeArgu(prefix: string): Argu {
        
          // TODO: caching, make arguments optionals
          return function Argu(
            args: args | string,
        Severity: Minor
        Found in gubu.ts - About 5 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 nodize has 127 lines of code (exceeds 25 allowed). Consider refactoring.
        Invalid

        function nodize<S>(shape?: any, depth?: number, meta?: NodeMeta): Node<S> {
        
          // If using builder as property of Gubu, `this` is just Gubu, not a node.
          if (make === shape) {
            shape = undefined
        Severity: Major
        Found in gubu.ts - About 5 hrs to fix

          Function MakeArgu has 93 lines of code (exceeds 25 allowed). Consider refactoring.
          Invalid

          function MakeArgu(prefix: string): Argu {
          
            // TODO: caching, make arguments optionals
            return function Argu(
              args: args | string,
          Severity: Major
          Found in gubu.ts - About 3 hrs to fix

            Function handleValidate has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Invalid

            function handleValidate(vf: Validate, s: State): Update {
              let update: Update = {}
            
              let valid = false
              let thrown
            Severity: Minor
            Found in gubu.ts - About 3 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 Argu has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Invalid

              return function Argu(
                args: args | string,
                whence: string | Record<string, any>,
                argSpec?: Record<string, any>
              ) {
            Severity: Major
            Found in gubu.ts - About 3 hrs to fix

              Function expr has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Invalid

              function expr(spec: {
                src: string
                val: any
                tokens?: string[]
                i?: number
              Severity: Minor
              Found in gubu.ts - About 3 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 Rename has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Invalid

              const Rename = function <V>(this: any, inopts: any, shape?: Node<V> | V): Node<V> {
                let node = buildize(this, shape)
              
                let opts = S.object === typeof inopts ? inopts || {} : {}
                let name = S.string === typeof inopts ? inopts : opts.name
              Severity: Major
              Found in gubu.ts - About 2 hrs to fix

                Function makeErrImpl has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Invalid

                function makeErrImpl(
                  why: string,
                  s: State,
                  mark: number,
                  text?: string,
                Severity: Major
                Found in gubu.ts - About 2 hrs to fix

                  Function expr has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Invalid

                  function expr(spec: {
                    src: string
                    val: any
                    tokens?: string[]
                    i?: number
                  Severity: Major
                  Found in gubu.ts - About 2 hrs to fix

                    Function stringify has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Invalid

                    function stringify(src: any, replacer?: any, dequote?: boolean, expand?: boolean) {
                      let str: string
                    
                      if (!expand &&
                        src && src.$ && (GUBU$ === src.$.gubu$ || true === (src.$ as any).gubu$)) {
                    Severity: Major
                    Found in gubu.ts - About 2 hrs to fix

                      Function handleValidate has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Invalid

                      function handleValidate(vf: Validate, s: State): Update {
                        let update: Update = {}
                      
                        let valid = false
                        let thrown
                      Severity: Major
                      Found in gubu.ts - About 2 hrs to fix

                        Function Key has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Invalid

                        const Key = function(this: any, depth?: number | Function, join?: string) {
                          let node = buildize(this)
                        
                          let ascend = S.number === typeof depth
                          node.t = (S.string as ValType)
                        Severity: Minor
                        Found in gubu.ts - 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 Exact has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const Exact = function(this: any, ...vals: any[]) {
                          let node = buildize()
                        
                          node.b.push(function Exact(val: any, update: Update, state: State) {
                            for (let i = 0; i < vals.length; i++) {
                        Severity: Minor
                        Found in gubu.ts - 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

                        Consider simplifying this complex logical expression.
                        Open

                                else if (!(
                                  S.any === s.type ||
                                  S.list === s.type ||
                                  undefined === s.val ||
                                  s.type === s.valType ||
                        Severity: Critical
                        Found in gubu.ts - About 1 hr to fix

                          Function before has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Invalid

                              let before = (val: any, update: Update, s: State) => {
                                if (undefined === val && 0 < claim.length) {
                                  s.ctx.Rename = (s.ctx.Rename || {})
                                  s.ctx.Rename.fromDflt = (s.ctx.Rename.fromDflt || {})
                          
                          
                          Severity: Minor
                          Found in gubu.ts - About 1 hr to fix

                            Function next has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Invalid

                              next() {
                                // Uncomment for debugging (definition below).
                                // this.printStacks()
                            
                                this.stop = false
                            Severity: Minor
                            Found in gubu.ts - About 1 hr to fix

                              Function Check has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Invalid

                              const Check = function <V>(
                                this: any,
                                check: Validate | RegExp | string,
                                shape?: Node<V> | V
                              ): Node<V> {
                              Severity: Minor
                              Found in gubu.ts - 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 Refer has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Invalid

                              const Refer = function <V>(this: any, inopts: any, shape?: Node<V> | V): Node<V> {
                                let node = buildize(this, shape)
                              
                                let opts = S.object === typeof inopts ? inopts || {} : {}
                                let name = S.string === typeof inopts ? inopts : opts.name
                              Severity: Minor
                              Found in gubu.ts - 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

                              Consider simplifying this complex logical expression.
                              Invalid

                                  else if (true === shape.$.gubu$) {
                                    let node = { ...shape }
                                    node.$ = { v$: VERSION, ...node.$, gubu$: GUBU$ }
                              
                                    node.v =
                              Severity: Critical
                              Found in gubu.ts - About 1 hr to fix

                                Function Key has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Invalid

                                const Key = function(this: any, depth?: number | Function, join?: string) {
                                  let node = buildize(this)
                                
                                  let ascend = S.number === typeof depth
                                  node.t = (S.string as ValType)
                                Severity: Minor
                                Found in gubu.ts - About 1 hr to fix

                                  Function buildize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Invalid

                                  function buildize<V>(node0?: any, node1?: any): Node<V> {
                                    // Detect chaining. If not chained, ignore `this` if it is the global context.
                                    let node =
                                      nodize(null == node0 || node0.window === node0 || node0.global === node0
                                        ? node1 : node0)
                                  Severity: Minor
                                  Found in gubu.ts - About 1 hr to fix

                                    Function Check has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Invalid

                                    const Check = function <V>(
                                      this: any,
                                      check: Validate | RegExp | string,
                                      shape?: Node<V> | V
                                    ): Node<V> {
                                    Severity: Minor
                                    Found in gubu.ts - About 1 hr to fix

                                      Function Some has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Invalid

                                      const Some = function(this: any, ...inshapes: any[]) {
                                        let node = buildize()
                                        node.t = (S.list as ValType)
                                        node.r = true
                                      
                                      
                                      Severity: Minor
                                      Found in gubu.ts - About 1 hr to fix

                                        Function One has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Invalid

                                        const One = function(this: any, ...inshapes: any[]) {
                                          let node = buildize()
                                          node.t = (S.list as ValType)
                                          node.r = true
                                        
                                        
                                        Severity: Minor
                                        Found in gubu.ts - About 1 hr to fix

                                          Function Exact has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                          const Exact = function(this: any, ...vals: any[]) {
                                            let node = buildize()
                                          
                                            node.b.push(function Exact(val: any, update: Update, state: State) {
                                              for (let i = 0; i < vals.length; i++) {
                                          Severity: Minor
                                          Found in gubu.ts - About 1 hr to fix

                                            Function All has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Invalid

                                            const All = function(this: any, ...inshapes: any[]) {
                                              let node = buildize()
                                              node.t = (S.list as ValType)
                                              node.r = true
                                            
                                            
                                            Severity: Minor
                                            Found in gubu.ts - About 1 hr to fix

                                              Avoid deeply nested control flow statements.
                                              Invalid

                                                          if (null != val) {
                                                            s.ctx.log && s.ctx.log('so', s)
                                              
                                                            let hasKeys = false
                                                            let vkeys = keys(n.v)
                                              Severity: Major
                                              Found in gubu.ts - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                          if (n.r && valundef) {
                                                            s.ignoreVal = true
                                                            s.curerr.push(makeErrImpl(S.required, s, 1030))
                                                          }
                                                          else if (!valundef && !isarr(s.val)) {
                                                Severity: Major
                                                Found in gubu.ts - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Invalid

                                                              if (!s.match) {
                                                                s.parent[name] = update.val
                                                              }
                                                  Severity: Major
                                                  Found in gubu.ts - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                            else if (S.regexp === s.type) {
                                                              if (valundef && !n.r) {
                                                                s.ignoreVal = true
                                                              }
                                                              else if (S.string !== s.valType) {
                                                    Severity: Major
                                                    Found in gubu.ts - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                  for (let eI = 0; eI < s.err.length; eI++) {
                                                                    if (s.err[eI].k === fromDflt.key) {
                                                                      s.err.splice(eI, 1)
                                                                      eI--
                                                                    }
                                                      Severity: Major
                                                      Found in gubu.ts - About 45 mins to fix

                                                        Function makeErrImpl has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Invalid

                                                          why: string,
                                                          s: State,
                                                          mark: number,
                                                          text?: string,
                                                          user?: any,
                                                        Severity: Minor
                                                        Found in gubu.ts - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Invalid

                                                                          if (top.v[keys[sI]].m.rest) {
                                                                            argmap[keys[sI]]
                                                                              .splice(top.v[keys[sI]].m.rest_pos + kI - sI, 0,
                                                                                argmap[keys[sI - 1]])
                                                                          }
                                                          Severity: Major
                                                          Found in gubu.ts - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                        if (!keep) {
                                                                          delete s.parent[cn]
                                                                        }
                                                                        else {
                                                                          let j = s.cI + 1
                                                            Severity: Major
                                                            Found in gubu.ts - About 45 mins to fix

                                                              Consider simplifying this complex logical expression.
                                                              Invalid

                                                                          if (hasValueElements || hasFixedElements) {
                                                                            s.pI = s.nI
                                                              
                                                                            let elementIndex = 0
                                                              
                                                              
                                                              Severity: Major
                                                              Found in gubu.ts - About 40 mins to fix

                                                                Function All has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                Invalid

                                                                const All = function(this: any, ...inshapes: any[]) {
                                                                  let node = buildize()
                                                                  node.t = (S.list as ValType)
                                                                  node.r = true
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in gubu.ts - About 35 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 truncate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                Invalid

                                                                function truncate(str?: string, len?: number): string {
                                                                  let strval = String(str)
                                                                  let outlen = null == len || isNaN(len) ? 30 : len < 0 ? 0 : ~~len
                                                                  let strlen = null == str ? 0 : strval.length
                                                                  let substr = null == str ? '' : strval.substring(0, strlen)
                                                                Severity: Minor
                                                                Found in gubu.ts - About 35 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 Some has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                Invalid

                                                                const Some = function(this: any, ...inshapes: any[]) {
                                                                  let node = buildize()
                                                                  node.t = (S.list as ValType)
                                                                  node.r = true
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in gubu.ts - About 35 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 node2str has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                function node2str(n: Node<any>): string {
                                                                  return (null != n.s && '' !== n.s) ? n.s :
                                                                    (!n.r && undefined !== n.v) ?
                                                                      ('function' === typeof n.v.constructor ? n.v : n.v.toString())
                                                                      : n.t
                                                                Severity: Minor
                                                                Found in gubu.ts - About 35 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 One has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                Invalid

                                                                const One = function(this: any, ...inshapes: any[]) {
                                                                  let node = buildize()
                                                                  node.t = (S.list as ValType)
                                                                  node.r = true
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in gubu.ts - About 35 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 next has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                Invalid

                                                                  next() {
                                                                    // Uncomment for debugging (definition below).
                                                                    // this.printStacks()
                                                                
                                                                    this.stop = false
                                                                Severity: Minor
                                                                Found in gubu.ts - About 35 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

                                                                Avoid too many return statements within this function.
                                                                Invalid

                                                                        return JP(head)
                                                                Severity: Major
                                                                Found in gubu.ts - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Invalid

                                                                      return expr(spec)
                                                                  Severity: Major
                                                                  Found in gubu.ts - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Invalid

                                                                      return spec.val
                                                                    Severity: Major
                                                                    Found in gubu.ts - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Invalid

                                                                              return new RegExp(head.substring(1, head.length - 1))
                                                                      Severity: Major
                                                                      Found in gubu.ts - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Invalid

                                                                            return expr(spec)
                                                                        Severity: Major
                                                                        Found in gubu.ts - About 30 mins to fix

                                                                          Function valueLen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                          Invalid

                                                                          function valueLen(val: any) {
                                                                            return S.number === typeof (val) ? val :
                                                                              S.number === typeof (val?.length) ? val.length :
                                                                                null != val && S.object === typeof (val) ? keys(val).length :
                                                                                  NaN
                                                                          Severity: Minor
                                                                          Found in gubu.ts - 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 Define has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                          Invalid

                                                                          const Define = function <V>(this: any, inopts: any, shape?: Node<V> | V): Node<V> {
                                                                            let node = buildize(this, shape)
                                                                          
                                                                            let opts = S.object === typeof inopts ? inopts || {} : {}
                                                                            let name = S.string === typeof inopts ? inopts : opts.name
                                                                          Severity: Minor
                                                                          Found in gubu.ts - 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

                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                          Invalid

                                                                          const Above = function <V>(
                                                                            this: any,
                                                                            above: number | string,
                                                                            shape?: Node<V> | V
                                                                          ): Node<V> {
                                                                          Severity: Major
                                                                          Found in gubu.ts and 2 other locations - About 1 day to fix
                                                                          gubu.ts on lines 1933..1957
                                                                          gubu.ts on lines 1989..2013

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

                                                                          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

                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                          Invalid

                                                                          const Max = function <V>(
                                                                            this: any,
                                                                            max: number | string,
                                                                            shape?: Node<V> | V
                                                                          ): Node<V> {
                                                                          Severity: Major
                                                                          Found in gubu.ts and 2 other locations - About 1 day to fix
                                                                          gubu.ts on lines 1961..1985
                                                                          gubu.ts on lines 1989..2013

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

                                                                          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

                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                          Invalid

                                                                          const Below = function <V>(
                                                                            this: any,
                                                                            below: number | string,
                                                                            shape?: Node<V> | V
                                                                          ): Node<V> {
                                                                          Severity: Major
                                                                          Found in gubu.ts and 2 other locations - About 1 day to fix
                                                                          gubu.ts on lines 1933..1957
                                                                          gubu.ts on lines 1961..1985

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

                                                                          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

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Invalid

                                                                              if (!pass) {
                                                                                update.why = S.All
                                                                                update.err = [
                                                                                  makeErr(state,
                                                                                    S.Value + ' ' + S.$VALUE + S.forprop + S.$PATH +
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 4 hrs to fix
                                                                          gubu.ts on lines 1566..1574

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

                                                                          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

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Invalid

                                                                              if (!pass) {
                                                                                update.why = S.Some
                                                                                update.err = [
                                                                                  makeErr(state,
                                                                                    S.Value + ' ' + S.$VALUE + S.forprop + S.$PATH +
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 4 hrs to fix
                                                                          gubu.ts on lines 1525..1533

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

                                                                          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

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Invalid

                                                                                if (0 < n.a.length) {
                                                                                  for (let aI = 0; aI < n.a.length; aI++) {
                                                                                    let update = handleValidate(n.a[aI], s)
                                                                                    n = s.node
                                                                                    if (undefined !== update.done) {
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 3 hrs to fix
                                                                          gubu.ts on lines 689..698

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

                                                                          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

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Invalid

                                                                                if (0 < n.b.length) {
                                                                                  for (let bI = 0; bI < n.b.length; bI++) {
                                                                                    let update = handleValidate(n.b[bI], s)
                                                                                    n = s.node
                                                                                    if (undefined !== update.done) {
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 3 hrs to fix
                                                                          gubu.ts on lines 999..1008

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

                                                                          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

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Invalid

                                                                          const Before = function <V>(
                                                                            this: any,
                                                                            validate: Validate,
                                                                            shape?: Node<V> | V
                                                                          ): Node<V> {
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 2 hrs to fix
                                                                          gubu.ts on lines 1673..1681

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

                                                                          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

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Invalid

                                                                          const After = function <V>(
                                                                            this: any,
                                                                            validate: Validate,
                                                                            shape?: Node<V> | V
                                                                          ): Node<V> {
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 2 hrs to fix
                                                                          gubu.ts on lines 1661..1669

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

                                                                          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

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

                                                                                  (
                                                                                    null != top &&
                                                                                    top.$ &&
                                                                                    (GUBU$ === top.$.gubu$ || true === (top.$ as any).gubu$)
                                                                                  ) ? top.v : top) :
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 1 hr to fix
                                                                          gubu.ts on lines 1094..1094

                                                                          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

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

                                                                              n = (null != n && n.$ && (GUBU$ === n.$.gubu$ || true === (n.$ as any).gubu$)) ? n.v : n
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 1 hr to fix
                                                                          gubu.ts on lines 1103..1107

                                                                          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

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Invalid

                                                                            if (undefined === shape && 1 === arguments.length) {
                                                                              node.t = (S.undefined as ValType)
                                                                              node.v = undefined
                                                                            }
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 1 hr to fix
                                                                          gubu.ts on lines 1330..1333

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

                                                                          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

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Invalid

                                                                            if (undefined === shape && 1 === arguments.length) {
                                                                              node.t = (S.undefined as ValType)
                                                                              node.v = undefined
                                                                            }
                                                                          Severity: Major
                                                                          Found in gubu.ts and 1 other location - About 1 hr to fix
                                                                          gubu.ts on lines 1353..1356

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

                                                                          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

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

                                                                                for (let i = 0; i < vals.length; i++) {
                                                                                  if (valDftl === vals[i]) {
                                                                                    return true
                                                                                  }
                                                                                }
                                                                          Severity: Minor
                                                                          Found in gubu.ts and 1 other location - About 30 mins to fix
                                                                          gubu.ts on lines 1627..1631

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

                                                                          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

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

                                                                              for (let i = 0; i < vals.length; i++) {
                                                                                if (val === vals[i]) {
                                                                                  return true
                                                                                }
                                                                              }
                                                                          Severity: Minor
                                                                          Found in gubu.ts and 1 other location - About 30 mins to fix
                                                                          gubu.ts on lines 1637..1641

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

                                                                          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

                                                                          There are no issues that match your filters.

                                                                          Category
                                                                          Status