RubyLouvre/avalon

View on GitHub

Showing 214 of 347 total issues

Function slice has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    ap.slice = function(begin, end) {
        // IE < 9 gets unhappy with an undefined end argument
        end = (typeof end !== 'undefined') ? end : this.length

        // For native Array objects, we use the native slice function
Severity: Minor
Found in src/seed/lang.fix.js - 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 set has a Cognitive Complexity of 25 (exceeds 5 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 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 exports has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(config) {

        var options = {

            // base path that will be used to resolve all patterns (eg. files, exclude)
Severity: Major
Found in karma.conf.js - About 3 hrs to fix

    Function Computed has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    export var Computed = (function(_super) {
        __extends(Computed, _super);
    
        function Computed(name, options, vm) { //构造函数
            _super.call(this, name, undefined, vm)
    Severity: Minor
    Found in src/vmodel/Computed.js - 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 scanTag has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        scanTag(vdom, scope, parentChildren, isRoot) {
            var dirs = {},
                attrs = vdom.props,
                hasDir, hasFor
            for (var attr in attrs) {
    Severity: Major
    Found in src/renders/domRender.js - About 3 hrs to fix

      Function bind has a Cognitive Complexity of 23 (exceeds 5 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 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 dispatch has a Cognitive Complexity of 23 (exceeds 5 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 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

      File index.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { avalon, isObject, platform } from '../seed/core'
      import { cssDiff } from '../directives/css'
      import { dumpTree, groupTree, getRange } from '../renders/share'
      var legalTags = { wbr: 1, xmp: 1, template: 1 }
      var events = 'onInit,onReady,onViewChange,onDispose,onEnter,onLeave'
      Severity: Minor
      Found in src/component/index.js - About 3 hrs to fix

        File for.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { avalon, createFragment, platform, isObject, ap } from '../seed/core'
        
        import { VFragment } from '../vdom/VFragment'
        import { $$skipArray } from '../vmodel/reserved'
        
        
        Severity: Minor
        Found in src/directives/for.js - About 2 hrs to fix

          File domRender.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { avalon, config, inBrowser, delayCompileNodes, directives } from '../seed/core'
          import { fromDOM } from '../vtree/fromDOM'
          import { fromString } from '../vtree/fromString'
          
          import { VFragment } from '../vdom/VFragment'
          Severity: Minor
          Found in src/renders/domRender.js - About 2 hrs to fix

            Function dateFilter has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function dateFilter(date, format) {
                var locate = dateFilter.locate,
                    text = "",
                    parts = [],
                    fn, match
            Severity: Major
            Found in src/filters/date.js - About 2 hrs to fix

              Function createAction has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function createAction(action) {
                  var lower = action.toLowerCase()
                  return function (option) {
                      var dom = this.dom
                      var elem = avalon(dom)
              Severity: Major
              Found in src/effect/index.js - About 2 hrs to fix

                Function each has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                avalon.each = function(obj, fn) {
                    if (obj) { //排除null, undefined
                        var i = 0
                        if (isArrayLike(obj)) {
                            for (var n = obj.length; i < n; i++) {
                Severity: Minor
                Found in src/seed/lang.compact.js - About 2 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 parseTextDir has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                function parseTextDir(string) {
                    var closeTag = config.closeTag
                    var openTag = config.openTag
                    var closeTagFirst = closeTag.charAt(0)
                    var closeTagLength = closeTag.length
                Severity: Minor
                Found in src/vtree/fromString.js - About 2 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 from has a Cognitive Complexity of 19 (exceeds 5 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 2 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 duplexInit has a Cognitive Complexity of 19 (exceeds 5 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 2 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 Computed has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export var Computed = (function(_super) {
                    __extends(Computed, _super);
                
                    function Computed(name, options, vm) { //构造函数
                        _super.call(this, name, undefined, vm)
                Severity: Major
                Found in src/vmodel/Computed.js - About 2 hrs to fix

                  Function updateDataEvents has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function updateDataEvents(dom, data) {
                      var events = {}
                          //添加需要监听的事件
                      switch (data.dtype) {
                          case 'radio':
                  Severity: Major
                  Found in src/directives/duplex/updateDataEvents.compact.js - About 2 hrs to fix

                    Function getAttrs has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function getAttrs(string) {
                        var state = 'AttrName',
                            attrName = '',
                            attrValue = '',
                            quote,
                    Severity: Major
                    Found in src/vtree/fromString.js - About 2 hrs to fix

                      Function fixElement has a Cognitive Complexity of 18 (exceeds 5 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 2 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

                      Severity
                      Category
                      Status
                      Source
                      Language