RubyLouvre/avalon

View on GitHub

Showing 214 of 347 total issues

Function diffList has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function diffList(instance) {
    var cache = instance.cache
    var newCache = {}
    var fuzzy = []
    var list = instance.preFragments
Severity: Minor
Found in src/directives/for.js - About 1 hr to fix

    Function addScope has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function addScope(expr, type) {
        var cacheKey = expr + ':' + type
        var cache = exprCache.get(cacheKey)
        if (cache) {
            return cache.slice(0)
    Severity: Minor
    Found in src/parser/index.js - About 1 hr to fix

      Function resetDeps has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function resetDeps(action) {
          var prev = action.observers,
              curr = [],
              checked = {},
              ids = []
      Severity: Minor
      Found in src/vmodel/transaction.js - About 1 hr to fix

        Function duplexInit has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function duplexInit() {
            var expr = this.expr
            var node = this.node
            var etype = node.props.type
            this.parseValue = parseValue
        Severity: Minor
        Found in src/directives/duplex/share.js - About 1 hr to fix

          Function toDOM has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              toDOM() {
                  if (this.dom)
                      return this.dom
                  var dom, tagName = this.nodeName
                  if (avalon.modern && svgTags[tagName]) {
          Severity: Minor
          Found in src/vdom/VElement.modern.js - About 1 hr to fix

            Function mix has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            avalon.mix = avalon.fn.mix = function() {
                var options, name, src, copy, copyIsArray, clone,
                    target = arguments[0] || {},
                    i = 1,
                    length = arguments.length,
            Severity: Minor
            Found in src/seed/lang.modern.js - About 1 hr to fix

              Function insertTbody has a Cognitive Complexity of 13 (exceeds 5 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

              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 makeTbody has a Cognitive Complexity of 13 (exceeds 5 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

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

              platform.modelFactory = function modelFactory(definition, dd) {
                  var $computed = definition.$computed || {}
                  delete definition.$computed
                  var core = new IProxy(definition, dd)
                  var $accessors = core.$accessors
              Severity: Minor
              Found in src/vmodel/share.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 move has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  move: function(event, callback) {
                      for (var i = 0; i < event.changedTouches.length; i++) {
                          var touch = event.changedTouches[i]
                          var pointer = Recognizer.pointers[touch.identifier]
                          if (!pointer) {
              Severity: Minor
              Found in src/gesture/recognizer.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 bind has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              avalon.bind = function(elem, type, fn) {
                  if (elem.nodeType === 1) {
                      var value = elem.getAttribute('avalon-events') || ''
                          //如果是使用ms-on-*绑定的回调,其uuid格式为e12122324,
                          //如果是使用bind方法绑定的回调,其uuid格式为_12
              Severity: Minor
              Found in src/dom/event/share.js - About 1 hr to fix

                Function updateAttrs has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function updateAttrs(node, attrs) {
                    for (var attrName in attrs) {
                        try {
                            var val = attrs[attrName]
                                // 处理路径属性
                Severity: Minor
                Found in src/dom/attr/compact.js - About 1 hr to fix

                  Function touchend has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      touchend: function(event) {
                          var targetElement = tapRecognizer.element
                          var now = Date.now()
                              //如果是touchstart与touchend相隔太久,可以认为是长按,那么就直接返回
                              //或者是在touchstart, touchmove阶段,判定其不该触发点击事件,也直接返回
                  Severity: Minor
                  Found in src/gesture/tap.js - About 1 hr to fix

                    Function shimHack has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function shimHack() {
                        if (msie < 10) {
                            avalon.cloneNode = fixClone
                        }
                        if (!document.contains) {
                    Severity: Minor
                    Found in src/dom/shim/compact.js - About 1 hr to fix

                      Function from has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function from(node) {
                          var type = node.nodeName.toLowerCase()
                          switch (type) {
                              case '#text':
                              case '#comment':
                      Severity: Minor
                      Found in src/vtree/fromDOM.js - About 1 hr to fix

                        Function modelFactory has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            platform.modelFactory = function modelFactory(definition, dd) {
                                var clone = {}
                                for (let i in definition) {
                                    clone[i] = definition[i]
                                    delete definition[i]
                        Severity: Minor
                        Found in src/vmodel/proxy.js - About 1 hr to fix

                          Function yieldDirectives has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              yieldDirectives() {
                                  var tuple
                                  while (tuple = this.bindings.shift()) {
                                      var vdom = tuple[0],
                                          scope = tuple[1],
                          Severity: Minor
                          Found in src/renders/domRender.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 touchend has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              touchend: function(event) {
                                  var targetElement = tapRecognizer.element
                                  var now = Date.now()
                                      //如果是touchstart与touchend相隔太久,可以认为是长按,那么就直接返回
                                      //或者是在touchstart, touchmove阶段,判定其不该触发点击事件,也直接返回
                          Severity: Minor
                          Found in src/gesture/tap.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 12 (exceeds 5 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

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

                          export function updateDataHandle(event) {
                              var elem = this
                              var field = elem._ms_duplex_
                              if (elem.composing) {
                                  //防止onpropertychange引发爆栈
                          Severity: Minor
                          Found in src/directives/duplex/updateDataHandle.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