Showing 7 of 7 total issues
Function handle
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
app.handle = function(msg, out) {
var self = this
, stack = this._stack
, idx = 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 _dispatch
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Router.prototype._dispatch = function(msg, next) {
debug('dispatching %s (%s)', msg.topic, msg.originalTopic);
var self = this;
- 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 handle
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
app.handle = function(msg, out) {
var self = this
, stack = this._stack
, idx = 0;
Function _dispatch
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Router.prototype._dispatch = function(msg, next) {
debug('dispatching %s (%s)', msg.topic, msg.originalTopic);
var self = this;
Function next
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function next(err) {
var layer = stack[idx++];
// all done
if (!layer) {
Function iter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function iter(i, err) {
function nextRoute(err) {
iter(i + 1, err);
}
Function match
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Route.prototype.match = function(topic, params) {
params = params || [];
var keys = this.keys
, m = this.regexp.exec(topic);
- 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"