Showing 15 of 17 total issues
Function exports
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
'use strict';
function readCodeclimateTokenFile() {
var filename = './codeclimate.txt';
Function exports
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (req, res, next) {
var finishedAt = null;
if (req && req._startedAt) {
Function resourceActionBlueprint
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resourceActionBlueprint(model, mountPath) {
var proto = Object.create({});
defineProperty(proto, 'model', model);
Function PolicyConfig
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function PolicyConfig(configData) {
var config = readConfig(configData);
for (var key in config) {
var record = config[key];
- 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 agregateActions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Resource.prototype.agregateActions = function (actions) {
var mountPaths = {};
for (var i in actions) {
var action = actions[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 resourceActionBlueprint
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function resourceActionBlueprint(model, mountPath) {
var proto = Object.create({});
defineProperty(proto, 'model', model);
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (req, res, next) {
var finishedAt = null;
if (req && req._startedAt) {
- 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 PolicyConfig
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PolicyConfig(configData) {
var config = readConfig(configData);
for (var key in config) {
var record = config[key];
Function validateAction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function validateAction(config) {
if (!config.id || typeof config.id !== 'string' && config.id.length > 0) {
throw new TypeError('ResourceAction(config.id) needs to be a non empty 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 resolveMountPath
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function resolveMountPath(model, controller) {
var mountPath = null;
if (controller && controller.path) {
mountPath = controller.path;
}
- 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 RequestError
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function RequestError(status, message) {
/**
* Instance property which shouldn't be enumerable because
* we don't want to list stored stack traces in serialized data.
- 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 validateTypeOfArrayRecords
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function validateTypeOfArrayRecords(array, name, type) {
if (!array || !array instanceof Array) {
throw new TypeError('ResourceAction(config.' + name + ') needs to be an Array');
} else {
for (var i = 0, j = array.length; i < j; 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 getRouter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Resource.prototype.getRouter = function () {
var resourceRouter = router()
, actions = this.agregateActions(this.actions)
, replaced = this.agregateActions(this.replaced);
- 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 actionWrapper
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function actionWrapper(handler) {
if (handler.wrapped === true) {
return handler;
}
- 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 Resource
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function Resource(model, controller, policies) {
var blueprint = {}
, actions = controller ? controller.actions : null;
- 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"