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) {
- Read upRead up
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'),
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);
- Read upRead up
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({
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) {
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);
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;
- Read upRead up
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') {
- Read upRead up
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);
- Read upRead up
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);
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) {
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) {
- Read upRead up
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) {
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) {
- Read upRead up
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;
}
- Read upRead up
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;
- Read upRead up
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) {
- Read upRead up
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"