RubyLouvre/avalon

View on GitHub
src/renders/domRender.js

Summary

Maintainability
D
1 day
Test Coverage

Function scanTag has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    scanTag(vdom, scope, parentChildren, isRoot) {
        var dirs = {},
            attrs = vdom.props,
            hasDir, hasFor
        for (var attr in attrs) {
Severity: Minor
Found in src/renders/domRender.js - About 6 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

    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 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 newUpdate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function newUpdate() {
          var oldVal = this.beforeUpdate()
          var newVal = this.value = this.get()
          if (this.callback && this.diff(newVal, oldVal)) {
              this.callback(this.node, this.value)
      Severity: Minor
      Found in src/renders/domRender.js - About 1 hr to fix

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

        function newUpdate() {
            var oldVal = this.beforeUpdate()
            var newVal = this.value = this.get()
            if (this.callback && this.diff(newVal, oldVal)) {
                this.callback(this.node, this.value)
        Severity: Minor
        Found in src/renders/domRender.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

        Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
        Open

        import { avalon, config, inBrowser, delayCompileNodes, directives } from '../seed/core'
        Severity: Minor
        Found in src/renders/domRender.js by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        There are no issues that match your filters.

        Category
        Status