DaQuirm/nexus

View on GitHub

Showing 17 of 35 total issues

Function update has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

nxt.ContentRegion.prototype.update = function (state) {
    var hasRenderer = typeof state.renderer !== 'undefined';
    var noCommand = typeof state.command === 'undefined';
    if (hasRenderer) {
        if (noCommand) {
Severity: Minor
Found in src/nxt/content-region.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 AuthForm has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

AuthApp.Views.AuthForm = function(user) {
    return nxt.Element('div',
        nxt.Element('form',
            nxt.Element('label',
                nxt.Attr('for', 'login-input'),
Severity: Minor
Found in demos/auth/src/auth.js - About 1 hr to fix

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

    nx.AjaxModel.prototype.request = function (options) {
        var _this = this;
        var url = nx.Utils.interpolateString(options.url, this.data.value);
        this.xhr = new XMLHttpRequest();
        this.xhr.open(options.method, url, true);
    Severity: Minor
    Found in src/core/ajax-model.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 exports has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(grunt) {
        grunt.loadNpmTasks('grunt-coffee');
        grunt.loadNpmTasks('grunt-less');
    
        grunt.initConfig({
    Severity: Minor
    Found in demos/todo-list/grunt.js - About 1 hr to fix

      Function update has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      nxt.ContentRegion.prototype.update = function (state) {
          var hasRenderer = typeof state.renderer !== 'undefined';
          var noCommand = typeof state.command === 'undefined';
          if (hasRenderer) {
              if (noCommand) {
      Severity: Minor
      Found in src/nxt/content-region.js - About 1 hr to fix

        Function request has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        nx.AjaxModel.prototype.request = function (options) {
            var _this = this;
            var url = nx.Utils.interpolateString(options.url, this.data.value);
            this.xhr = new XMLHttpRequest();
            this.xhr.open(options.method, url, true);
        Severity: Minor
        Found in src/core/ajax-model.js - About 1 hr to fix

          Function map has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          nx.Mapping.prototype.map = function (source, target) {
              if (typeof this.pattern !== 'undefined') {
                  for (var item in this.pattern) {
                      if (item === '_' && typeof target !== 'undefined') {
                          target[this.pattern[item]] = source;
          Severity: Minor
          Found in src/core/mapping.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 render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              render: function (data, domContext) {
                  var attrMap = {};
                  if (typeof data.items !== 'undefined') {
                      for (var key in data.items) {
                          if (key === 'value') {
          Severity: Minor
          Found in src/nxt/renderers/attr-renderer.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 render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              render: function (data, domContext) {
                  if (typeof domContext.content !== 'undefined') {
                      domContext.container.replaceChild(data.node, domContext.content);
                  } else if (typeof domContext.insertReference !== 'undefined') {
                      domContext.container.insertBefore(data.node, domContext.insertReference);
          Severity: Minor
          Found in src/nxt/renderers/node-renderer.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 render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render: function (data, domContext) {
                  if (typeof domContext.content !== 'undefined') {
                      domContext.container.replaceChild(data.node, domContext.content);
                  } else if (typeof domContext.insertReference !== 'undefined') {
                      domContext.container.insertBefore(data.node, domContext.insertReference);
          Severity: Minor
          Found in src/nxt/renderers/node-renderer.js - About 1 hr to fix

            Function insertBefore has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            nx.FilterRefinement.prototype.insertBefore = function (data, values) {
                var filtered = this._filterItems(data.items, values);
            
                var closestIndex = 0;
                while (this._indexes[closestIndex] < data.index) {
            Severity: Minor
            Found in src/refinements/filter-refinement.js - About 1 hr to fix

              Function remove has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              nx.OrderTree.prototype.remove = function (node) {
                  var current = node;
                  var rank = this.rank(node);
              
                  while (current !== this.root) {
              Severity: Minor
              Found in src/refinements/order-tree.js - About 45 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 OrderTreeNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              nx.OrderTreeNode = function (data, left, right, rank, parent) {
              Severity: Minor
              Found in src/refinements/order-tree-node.js - About 35 mins to fix

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

                    enter: function (cell) {
                        var queue = [cell];
                
                        if (cell.cleanup) {
                            while (queue.length > 0) {
                Severity: Minor
                Found in src/nxt/command-cell-model.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 rank has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                nx.OrderTree.prototype.rank = function (node) {
                    var rank = 0;
                    if (node.left !== null) {
                        rank = node.left.rank;
                    }
                Severity: Minor
                Found in src/refinements/order-tree.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 sync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                nx.Binding.prototype.sync = function (value, oldValue) {
                    if (this.locked) {
                        return;
                    }
                    var targets;
                Severity: Minor
                Found in src/core/binding.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 _flatBind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                nx.Cell.prototype._flatBind = function (cell, selector, conversion, method) {
                    var _this = this;
                    var binding;
                
                    var getTarget = function (value) {
                Severity: Minor
                Found in src/core/cell.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