RubyLouvre/avalon

View on GitHub

Showing 214 of 347 total issues

Function fix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        fix: function(elem, fn) {
            return function(e) {
                var delta = e[fixWheelDelta] > 0 ? -120 : 120
                e.wheelDelta = ~~elem._ms_wheel_ + delta
                elem._ms_wheel_ = e.wheelDeltaY = e.wheelDelta
Severity: Minor
Found in src/dom/event/share.js - 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 IProxy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function IProxy(definition, dd) {
    avalon.mix(this, definition)
    avalon.mix(this, $$skipArray)
    this.$hashcode = avalon.makeHashCode('$')
    this.$id = this.$id || this.$hashcode
Severity: Minor
Found in src/vmodel/share.js - 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 collectDeps has a Cognitive Complexity of 6 (exceeds 5 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 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 numberFilter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function numberFilter(number, decimals, point, thousands) {
    //https://github.com/txgruppi/number_format
        //form http://phpjs.org/functions/number_format/
        //number 必需,要格式化的数字
        //decimals 可选,规定多少个小数位。
Severity: Minor
Found in src/filters/number.js - 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 Action has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function Action(vm, options, callback) {
    for (var i in options) {
        if (protectedMenbers[i] !== 1) {
            this[i] = options[i]
        }
Severity: Minor
Found in src/vmodel/Action.js - 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 touchmove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    touchmove: function(event) {
        Recognizer.move(event, function(pointer) {
            if (pointer.distance > 10 && pointer.pressingHandler) {
                pressRecognizer.cancelPress(pointer)
                if (pointer.status === 'tapping') {
Severity: Minor
Found in src/gesture/press.js - 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 touchend has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    touchend: function(event) {
        Recognizer.end(event, function(pointer, touch) {
            pressRecognizer.cancelPress(pointer)
            if (pointer.status === 'tapping') {
                pointer.lastTime = Date.now()
Severity: Minor
Found in src/gesture/press.js - 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 compactParseJSON has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function compactParseJSON(data) {
    if (typeof data === 'string') {
        data = data.trim()
        if (data) {
            if (rvalidchars.test(data.replace(rvalidescape, '@')
Severity: Minor
Found in src/dom/attr/parseJSON.compact.js - 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 equalArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function equalArray(a, b, level) {
    if (a.length !== b.length) {
        return false
    }
    for (let i = a.length - 1; i >= 0; i--) {
Severity: Minor
Found in src/directives/css.js - 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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    update: function (vdom, value) {
        var props = vdom.props
            for(var i in value){
               if(!!value[i] === false){
                  delete props[i]
Severity: Minor
Found in src/directives/attr.compact.js - 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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    update: function (vdom, value) {
        var props = vdom.props
            for(var i in value){
               if(!!value[i] === false){
                  delete props[i]
Severity: Minor
Found in src/directives/attr.modern.js - 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 isInCache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function isInCache(cache, id) {
    var c = cache[id]
    if (c) {
        var arr = c.arr
            /* istanbul ignore if*/
Severity: Minor
Found in src/directives/for.js - 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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    update: function(vdom, value) {
        if (this.isShow === void 0 && value) {
            continueScan(this, vdom)
            return
        }
Severity: Minor
Found in src/directives/if.js - 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 pollValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function pollValue(isIE, valueHijack) {
    var dom = this.dom
    if (this.isString
        && valueHijack
        && !isIE
Severity: Minor
Found in src/directives/duplex/compact.js - 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

Severity
Category
Status
Source
Language