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 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 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
Avoid too many return
statements within this function. Open
return create(comp);
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"