Showing 14 of 26 total issues
Function create
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Container.prototype.create = function(id, parent, ecomp, options) {
//if (id == 'http://i.bixbyjs.org/http/middleware/session') {
if (id == 'http://i.bixbyjs.org/http/middleware/authenticate') {
console.log('!!! ATTEMPTED TO CREATE AUTH MIDDLEWARE: ' + parent.id);
}
Function components
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
InjectedContainer.prototype.components = function(q, filt) {
if (typeof q == 'string' && !Array.isArray(q)) {
q = [ q ];
} else if (typeof q == 'boolean') {
filt = q;
- 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 create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Component.prototype.create = function(container, options) {
options = options || {};
debug('create %s', this.id);
Function components
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
InjectedContainer.prototype.components = function(q, filt) {
if (typeof q == 'string' && !Array.isArray(q)) {
q = [ q ];
} else if (typeof q == 'boolean') {
filt = q;
Function use
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Container.prototype.use = function(ns, asm) {
if (typeof ns !== 'string') {
// force ns to be an empty string if not specified
asm = ns;
ns = '';
Function _registerComponent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Container.prototype._registerComponent = function(id, mod, source) {
var spec, pattern;
if (mod['@literal']) {
pattern = 'literal';
Function Component
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function Component(id, mod, asm) {
var keys, i, len;
this.id = id;
this.dependencies = mod['@require'] || [];
- 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 use
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Container.prototype.use = function(ns, asm) {
if (typeof ns !== 'string') {
// force ns to be an empty string if not specified
asm = ns;
ns = '';
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Component.prototype.create = function(container, options) {
options = options || {};
debug('create %s', this.id);
- 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
Avoid too many return
statements within this function. Open
return create(comp);
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function() {
var settings = new Settings();
settings.set('env', process.env.NODE_ENV || 'development');
settings.set('title', 'To Do List')
- 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 _registerComponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Container.prototype._registerComponent = function(id, mod, source) {
var spec, pattern;
if (mod['@literal']) {
pattern = 'literal';
- 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 resolve
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Container.prototype.resolve = function(id, parent, optional) {
var resolvers = this._resolvers
, fn, rid, i, len;
for (i = 0, len = resolvers.length; i < len; ++i) {
fn = resolvers[i];
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function() {
var settings = new Settings();
settings.set('env', process.env.NODE_ENV || 'development');
settings.set('title', 'To Do List')
- 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"