RubyLouvre/avalon

View on GitHub

Showing 214 of 347 total issues

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

function collectFeild(nodes, fields, validator) {
    for (var i = 0, vdom; vdom = nodes[i++];) {
        var duplex = vdom.rules && vdom.duplex
        if (duplex) {
            fields.push(duplex)
Severity: Minor
Found in src/directives/validate.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 collectHooks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function collectHooks(a, list) {
    for (var i in a) {
        if (componentEvents[i]) {
            if (typeof a[i] === 'function' &&
                i.indexOf('on') === 0) {
Severity: Minor
Found in src/component/index.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 deepEquals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function deepEquals(a, b, level) {
    if (level === 0)
        return a === b
    if (a === null && b === null)
        return true
Severity: Minor
Found in src/directives/css.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 setOption has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function setOption(vdom, values) {
    var props = vdom.props
    if (!('disabled' in props)) {
        var value = getOptionValue(vdom, props)
            value = String(value || '').trim()
Severity: Minor
Found in src/directives/duplex/option.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

Avoid too many return statements within this function.
Open

    return !(val && val.nodeName && val.nodeType)
Severity: Major
Found in src/vmodel/share.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return !obj.window //IE6-8 window
    Severity: Major
    Found in src/seed/lang.compact.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return true
      Severity: Major
      Found in src/seed/lang.compact.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return 3
        Severity: Major
        Found in src/gesture/recognizer.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return NaN
          Severity: Major
          Found in src/gesture/recognizer.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return 5
            Severity: Major
            Found in src/gesture/recognizer.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return false
              Severity: Major
              Found in src/vmodel/share.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return false
                Severity: Major
                Found in src/seed/lang.compact.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return key === undefined || ohasOwn.call(obj, key)
                  Severity: Major
                  Found in src/seed/lang.compact.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return 4
                    Severity: Major
                    Found in src/gesture/recognizer.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return equalObject(a, b, level)
                      Severity: Major
                      Found in src/directives/css.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return a === b
                        Severity: Major
                        Found in src/directives/css.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return true
                          Severity: Major
                          Found in src/directives/css.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return false
                            Severity: Major
                            Found in src/directives/css.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return equalArray(a, b, level)
                              Severity: Major
                              Found in src/directives/css.js - About 30 mins to fix

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language