Showing 59 of 136 total issues
Function run
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
'run': function (src, params) {
var self = this;
if (typeof src !== 'string') {
- 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 recursiveDelete
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
'recursiveDelete': function (path) {
var self = this;
if (!self.pathExists(path)) return;
- 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 html
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
'html': function (tagName, data) {
var self = this;
if (!tagName) {
Function initialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
'initialize': function () {
var self = this;
_super.initialize.apply(self, arguments);
Function parse
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
'parse': function (model, raw, dependencies) {
var self = this;
var attributes = model.attributes;
raw = raw || attributes.raw;
Function save
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
save: function(key, val, options) {
var attrs, method, xhr, attributes = this.attributes;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || typeof key === 'object') {
Function getPathType
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
'getPathType': function (path) {
var self = this;
_.each(self.options.paths.initializers, function (initializersPath) {
Function lazyLoadMiddleware
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
'lazyLoadMiddleware': function (req, res, next) {
var self = this;
var middleware = self.resolveMiddleware(req.url) || [];
- 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 parsePosition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
'parsePosition': function (string) {
var self = this;
var parts = string.split('/');
var index = 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 fetch
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
'fetch': function (paths) {
var self = this;
var started = new Date();
var deferred = self.deferred();
Function fetch
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
'fetch': function (path, logger) {
var self = this;
path = path || self.attributes.path;
var deferred = self.deferred();
Function run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
'run': function (href, innerText, params, block) {
var self = this;
if (typeof href !== 'string') {
Function generate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
'generate': function () {
if (process.env.USE_STATIC_PUBLIC) return;
var self = this;
Function parseRawMeta
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
'parseRawMeta': function (raw, meta) {
var self = this;
meta = meta || {};
Function parse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
'parse': function (model, raw, dependencies) {
var self = this;
var attributes = model.attributes;
raw = self.assertAttributes(attributes, raw);
Function parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
'parse': function (model, raw, dependencies) {
var self = this;
var attributes = model.attributes;
raw = self.assertAttributes(attributes, raw);
- 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 bootstrap
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
'bootstrap': function () {
var self = this;
var meta = self.options.meta;
var deferred = self.deferred();
Function parseUrl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
'parseUrl': function (path) {
var self = this;
if (!path) {
Function lazyLoadMiddleware
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
'lazyLoadMiddleware': function (req, res, next) {
var self = this;
var middleware = self.resolveMiddleware(req.url) || [];
Function renderValues
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderValues (value, key, collection) {
if (key === 'page' || key === 'raw') return;
if (typeof value === 'string') {