Showing 25 of 31 total issues
Function exports
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(root) {
// root required
if (!root) throw new Error('ribs.middleware() root path required');
Function cropConstraintsHook
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
hooks.cropConstraintsHook = function(params, image) {
var dstWidth = params.width,
dstHeight = params.height,
anchor = params.anchor,
gravity = params.gravity,
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
Pipeline.prototype.use = function(name, params) {
// bypass on error
if (this.error) return this;
try {
- 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 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
// load npm tasks
require('load-grunt-tasks')(grunt);
// load time grunt
require('time-grunt')(grunt);
Function parseArguments
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseArguments() {
var src = args._[0],
dst = args._[1],
operations;
Function parseOperations
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseOperations(req, next, callback) {
var url = req.url,
operations = [],
current;
Function to
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function to(params, image, next) {
// arguments type
check('next', next, false, 'function');
try {
Function computeFormula
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
utils.computeFormula = function(formula, number) {
var f = parseFloat(formula),
i, o, v, len;
// early return for falsy values
- 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 cropConstraintsHook
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
hooks.cropConstraintsHook = function(params, image) {
var dstWidth = params.width,
dstHeight = params.height,
anchor = params.anchor,
gravity = params.gravity,
Function use
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Pipeline.prototype.use = function(name, params) {
// bypass on error
if (this.error) return this;
try {
Function crop
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function crop(params, image, next) {
var width, height;
// arguments type
check('next', next, false, 'function');
Function resizeConstraintsHook
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
hooks.resizeConstraintsHook = function(params, image) {
var dstWidth = params.width,
dstHeight = params.height,
srcWidth = image.width,
srcHeight = image.height;
- 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 ribs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var ribs = function(src, dst, bulk, callback) {
var pipeline = new Pipeline();
/** `(bulk, callback)` */
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(root) {
// root required
if (!root) throw new Error('ribs.middleware() root path required');
- 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 resizeConstraintsHook
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
hooks.resizeConstraintsHook = function(params, image) {
var dstWidth = params.width,
dstHeight = params.height,
srcWidth = image.width,
srcHeight = image.height;
Function from
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function from(src, next) {
check('next', next, false, 'function');
try {
check('params', src, false, 'string', 'object', 'array');
Function resize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resize(params, image, next) {
// arguments type
check('next', next, false, 'function');
try {
Function crop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function crop(params, image, next) {
var width, height;
// arguments type
check('next', next, false, 'function');
- 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 computeRegionOrigin
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
utils.computeRegionOrigin = function(anchor, width, height, x, y, coords) {
Function resize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function resize(params, image, next) {
// arguments type
check('next', next, false, 'function');
try {
- 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"