RubyLouvre/avalon

View on GitHub

Showing 214 of 347 total issues

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

    update: function (vdom, value) {
        var dom = vdom.dom
        if (dom && dom.nodeType == 1) {

            var dirType = this.type
Severity: Minor
Found in src/directives/class.hover.active.js - About 1 hr to fix

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

            set(target, name, value) {
                    if (name === '$model' || name === '$track') {
                        return true
                    }
                    if (name in $$skipArray) {
    Severity: Minor
    Found in src/vmodel/proxy.js - About 1 hr to fix

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

      function insertTbody(nodes) {
          var tbody = false
          for (var i = 0, n = nodes.length; i < n; i++) {
              var node = nodes[i]
              if (rtbody.test(node.nodeName)) {
      Severity: Minor
      Found in src/vtree/fromString.js - About 1 hr to fix

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

        export function makeTbody(nodes) {
            var tbody = false
            for (var i = 0, n = nodes.length; i < n; i++) {
                var node = nodes[i]
                if (rtbody.test(node.nodeName)) {
        Severity: Minor
        Found in src/vtree/makeTbody.js - About 1 hr to fix

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

              rotate: function(event, status) {
                  var finger = rotateRecognizer.finger
                  var endAngel = rotateRecognizer.getAngle180(rotateRecognizer.center, finger.lastTouch)
                  var diff = rotateRecognizer.startAngel - endAngel
                  var direction = (diff > 0 ? 'right' : 'left')
          Severity: Minor
          Found in src/gesture/rotate.js - About 1 hr to fix

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

                update: function(vdom, value) {
                    //this.oldValue = value //★★防止递归
            
                    switch (this.readyState) {
                        case 0:
            Severity: Minor
            Found in src/component/index.js - About 1 hr to fix

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

              export function groupTree(parent, children) {
                  children && children.forEach(function (vdom) {
                      if (!vdom)
                          return
                      var vlength = vdom.children && getChildren(vdom.children)
              Severity: Minor
              Found in src/renders/share.js - About 1 hr to fix

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

                export function collectDeps(action, getter) {
                    if (!action.observers)
                        return
                    var preAction = avalon.trackingAction
                    if (preAction) {
                Severity: Minor
                Found in src/vmodel/transaction.js - About 1 hr to fix

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

                  function dispatch(event) {
                      event = new avEvent(event)
                      var type = event.type
                      var elem = event.target
                      var handlers = []
                  Severity: Minor
                  Found in src/dom/event/share.js - About 1 hr to fix

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

                    export function Directive(vm, binding, vdom, render) {
                        var type = binding.type
                        var decorator = avalon.directives[type]
                        if (inBrowser) {
                            var dom = avalon.vdom(vdom, 'toDOM')
                    Severity: Minor
                    Found in src/renders/Directive.js - About 1 hr to fix

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

                      function fixElement(dest, src) {
                          if (dest.nodeType !== 1) {
                              return
                          }
                          var nodeName = dest.nodeName.toLowerCase()
                      Severity: Minor
                      Found in src/dom/shim/fixClone.js - About 1 hr to fix

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

                        function updateList(instance) {
                            var before = instance.begin.dom
                            var parent = before.parentNode
                            var list = instance.fragments
                            var end = instance.end.dom
                        Severity: Minor
                        Found in src/directives/for.js - About 1 hr to fix

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

                          avalon.fn.val = function (value) {
                              var node = this[0]
                              if (node && node.nodeType === 1) {
                                  var get = arguments.length === 0
                                  var access = get ? ':get' : ':set'
                          Severity: Minor
                          Found in src/dom/val/compact.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                          avalon.fn.val = function (value) {
                              var node = this[0]
                              if (node && node.nodeType === 1) {
                                  var get = arguments.length === 0
                                  var access = get ? ':get' : ':set'
                          Severity: Minor
                          Found in src/dom/val/modern.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                              removeAll: function(all) { //移除N个元素
                                  var size = this.length
                                  var eliminate = Array.isArray(all) ?
                                      function(el) {
                                          return all.indexOf(el) !== -1
                          Severity: Minor
                          Found in src/vmodel/ProxyArray.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                              rotate: function(event, status) {
                                  var finger = rotateRecognizer.finger
                                  var endAngel = rotateRecognizer.getAngle180(rotateRecognizer.center, finger.lastTouch)
                                  var diff = rotateRecognizer.startAngel - endAngel
                                  var direction = (diff > 0 ? 'right' : 'left')
                          Severity: Minor
                          Found in src/gesture/rotate.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                          function collectTemplate(vdoms, obj) {
                              for (var i = 0, el; el = vdoms[i++]; ) {
                                  var props = el.props
                                  if (props) {
                                      var id = props['ms-controller'] ||
                          Severity: Minor
                          Found in src/renders/serverRender.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                              update: function (vdom, change, opts) {
                                  var dom = vdom.dom
                                  if (dom && dom.nodeType === 1) {
                                      //要求配置对象必须指定is属性,action必须是布尔或enter,leave,move
                                      var option = change || opts
                          Severity: Minor
                          Found in src/effect/index.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                          export function isPlainObjectCompact(obj, key) {
                              if (!obj || avalon.type(obj) !== 'object' || obj.nodeType || avalon.isWindow(obj)) {
                                  return false
                              }
                              try { //IE内置对象没有constructor
                          Severity: Minor
                          Found in src/seed/lang.compact.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                          function bootstrap() {
                              function doScrollCheck() {
                                  try { //IE下通过doScrollCheck检测DOM树是否建完
                                      root.doScroll('left')
                                      fireReady()
                          Severity: Minor
                          Found in src/dom/ready/compact.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Severity
                          Category
                          Status
                          Source
                          Language