RubyLouvre/avalon

View on GitHub

Showing 214 of 347 total issues

Function duplexDiff has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function duplexDiff(newVal, oldVal) {
    if (Array.isArray(newVal)) {
        if (newVal + '' !== this.compareVal) {
            this.compareVal = newVal + ''
            return true
Severity: Minor
Found in src/directives/duplex/share.js - About 45 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 deeply nested control flow statements.
Open

                        if (window.netscape) {
                            // Firefox <= 3.6 doesn't fire the 'input' event when text is filled in through autocomplete
                            events.DOMAutoComplete = updateModel
                        }
Severity: Major
Found in src/directives/duplex/updateDataEvents.compact.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (newVal[i] !== oldVal[i]) {
                                hasChange = true
                            }
    Severity: Major
    Found in src/directives/css.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (!deepEquals(newVal[i], oldVal[i], 4)) {
                                  this.value = newVal
                                  return true
                              }
      Severity: Major
      Found in src/directives/css.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (copyIsArray) {
                                copyIsArray = false
                                clone = src && Array.isArray(src) ? src : []
        
                            } else {
        Severity: Major
        Found in src/seed/lang.modern.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          } else if (copy !== void 0) {
                              target[name] = copy
                          }
          Severity: Major
          Found in src/seed/lang.modern.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (Array.isArray(objectSlot[name])) {
                                            objectSlot[name].push(el)
                                        } else {
                                            objectSlot[name] = [el]
                                        }
            Severity: Major
            Found in src/component/index.js - About 45 mins to fix

              Function diff has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  diff: function(validator) {
                      var vdom = this.node
                      if (vdom.validator) {
                          return
                      }
              Severity: Minor
              Found in src/directives/validate.js - About 45 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 deeply nested control flow statements.
              Open

                                      if (dom.style.cssText === '') {
                                          dom.removeAttribute('style')
                                      }
              Severity: Major
              Found in src/directives/visible.js - About 45 mins to fix

                Function indexOf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                        indexOf: function(item, index) {
                            var n = this.length,
                                i = ~~index
                            if (i < 0)
                                i += n
                Severity: Minor
                Found in src/seed/lang.fix.js - 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 touchstart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    touchstart: function(event) {
                        var pointers = Recognizer.pointers
                        Recognizer.start(event, avalon.noop)
                        var finger
                        for (var p in pointers) {
                Severity: Minor
                Found in src/gesture/rotate.js - 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 needClick has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    needClick: function(target) {
                        //判定是否使用原生的点击事件, 否则使用sendClick方法手动触发一个人工的点击事件
                        switch (target.nodeName.toLowerCase()) {
                            case 'button':
                            case 'select':
                Severity: Minor
                Found in src/gesture/tap.js - 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 newUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                function newUpdate() {
                    var oldVal = this.beforeUpdate()
                    var newVal = this.value = this.get()
                    if (this.callback && this.diff(newVal, oldVal)) {
                        this.callback(this.node, this.value)
                Severity: Minor
                Found in src/renders/domRender.js - 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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    get(key) {
                        var entry = this._keymap[key]
                            // 如果查找不到含有`key`这个属性的缓存对象
                        if (entry === void 0)
                            return
                Severity: Minor
                Found in src/seed/cache.js - 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 touchmove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    touchmove: function(event) {
                        if (pinchRecognizer.element && event.touches.length > 1) {
                            var position = [],
                                current = []
                            for (var i = 0; i < event.touches.length; i++) {
                Severity: Minor
                Found in src/gesture/pinch.js - 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 validateDOMNesting has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export function validateDOMNesting(parent, child) {
                
                    var parentTag = parent.nodeName
                    var tag = child.nodeName
                    var parentChild = nestObject[parentTag]
                Severity: Minor
                Found in src/vtree/validateDOMNesting.js - 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 toHTML has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    toHTML() {
                        var arr = []
                        var props = this.props || {}
                        for (var i in props) {
                            var val = props[i]
                Severity: Minor
                Found in src/vdom/VElement.js - 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 touchstart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    touchstart: function(event) {
                        //忽略多点触摸
                        if (event.targetTouches.length !== 1) {
                            return true
                        }
                Severity: Minor
                Found in src/gesture/tap.js - 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 dumpTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export function dumpTree(elem) {
                    if (elem) {
                        var firstChild
                        while (firstChild = elem.firstChild) {
                            if (firstChild.nodeType === 1) {
                Severity: Minor
                Found in src/renders/share.js - 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 toHTML has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    toHTML() {
                        var arr = []
                        var props = this.props || {}
                        for (var i in props) {
                            var val = props[i]
                Severity: Minor
                Found in src/vdom/VElement.modern.js - 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

                Severity
                Category
                Status
                Source
                Language