Showing 40 of 88 total issues
File index.js
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright 2014-2015 Yahoo! Inc.
// Copyrights licensed under the Mit License. See the accompanying LICENSE file for terms.
var assert = require('assert'),
PNGImage = require('pngjs-image'),
- Create a ticketCreate a ticket
Function exports
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
function versionInfo () {
return {
major: 1,
- Create a ticketCreate a ticket
Function generate
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
generate: function () {
var options = this._options,
blockOuts,
comparison,
- Create a ticketCreate a ticket
Function exports
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
function versionInfo () {
return {
major: 1,
- Read upRead up
- Create a ticketCreate a ticket
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 run
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
run: function (fn) {
var promise = Promise.resolve(), result;
PNGImage.log = function (text) {
- Create a ticketCreate a ticket
Function runSync
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
runSync: function () {
var result, gamma, i, len, rect, color;
PNGImage.log = function (text) {
- Create a ticketCreate a ticket
Function process
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
process: function () {
// Catch all image errors
PNGImage.log = function (text) {
this.log('ERROR: ' + text);
- Create a ticketCreate a ticket
Function compare
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
compare: function (comparison, flagField) {
var flagFieldIndexA, dataIndexA,
flagFieldIndexB, dataIndexB,
x, y, delta,
- Read upRead up
- Create a ticketCreate a ticket
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
prototype
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
BlinkDiff.prototype = {
/**
* Runs the comparison with a promise
*
- Create a ticketCreate a ticket
Function BlinkDiff
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function BlinkDiff (options) {
this._imageA = options.imageA;
this._imageAPath = options.imageAPath;
assert.ok(options.imageAPath || options.imageA, "Image A not given.");
- Create a ticketCreate a ticket
Function runSync
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
runSync: function () {
var result, gamma, i, len, rect, color;
PNGImage.log = function (text) {
- Read upRead up
- Create a ticketCreate a ticket
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
Output
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
{
/**
* Gets the path of the output image
*
* @method getImagePath
- Create a ticketCreate a ticket
Function process
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
process: function () {
// Catch all image errors
PNGImage.log = function (text) {
this.log('ERROR: ' + text);
- Read upRead up
- Create a ticketCreate a ticket
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 _shiftCompare
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
_shiftCompare: function (x, y, colorIndex, comparison, imageSrc, areaSrc, imageDst, areaDst) {
var xOffset, xLow, xHigh,
yOffset, yLow, yHigh,
- Read upRead up
- Create a ticketCreate a ticket
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
Config
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
{
/**
* Is in debug-mode?
*
* @method isDebugMode
- Create a ticketCreate a ticket
Function _shiftCompare
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
_shiftCompare: function (x, y, color, deltaThreshold, imageA, imageB, width, height, hShift, vShift, perceptual, gamma) {
var i, xOffset, xLow, xHigh, yOffset, yLow, yHigh, delta, color1, color2, localDeltaThreshold;
if ((hShift > 0) || (vShift > 0)) {
- Read upRead up
- Create a ticketCreate a ticket
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 domInfo
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function domInfo () {
var capturedTags = ["A", "SPAN", "OL", "UL", "LI", "HEADER", "FOOTER", "NAV", "ARTICLE", "SECTION", "ASIDE", "DIV", "APPLET", "CANVAS", "VIDEO", "TABLE", "DETAILS", "SUMMARY", "IFRAME", "MENU", "MAIN", "FIGURE", "FIELDSET"];
function loadDOMNode (inputNode, parentNode) {
- Create a ticketCreate a ticket
Function _pixelCompare
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
_pixelCompare: function (imageA, imageB, imageOutput, deltaThreshold, width, height, outputMaskColor, outputShiftColor, backgroundColor, hShift, vShift, perceptual, gamma) {
- Create a ticketCreate a ticket
Function _shiftCompare
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
_shiftCompare: function (x, y, color, deltaThreshold, imageA, imageB, width, height, hShift, vShift, perceptual, gamma) {
- Create a ticketCreate a ticket
Function _pixelCompare
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_pixelCompare: function (imageA, imageB, imageOutput, deltaThreshold, width, height, outputMaskColor, outputShiftColor, backgroundColor, hShift, vShift, perceptual, gamma) {
var difference = 0, i, x, y, delta, color1, color2;
for (x = 0; x < width; x++) {
for (y = 0; y < height; y++) {
- Read upRead up
- Create a ticketCreate a ticket
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"