Showing 40 of 88 total issues
Function _compare
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
_compare: function (imageA, imageB, imageOutput, deltaThreshold, outputMaskColor, outputShiftColor, backgroundColor, hShift, vShift, perceptual, gamma) {
- Create a ticketCreate a ticket
Function generate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
generate: function () {
var options = this._options,
blockOuts,
comparison,
- 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 findElementAt
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
findElementAt: function (x, y) {
var nodes,
result,
i;
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_shiftCompare: function (x, y, colorIndex, comparison, imageSrc, areaSrc, imageDst, areaDst) {
var xOffset, xLow, xHigh,
yOffset, yLow, yHigh,
- Create a ticketCreate a ticket
Function convertToPerceptual
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
convertToPerceptual: function () {
var i, len,
data,
pixelList,
- Create a ticketCreate a ticket
Function _loadImage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadImage: function (blob) {
var decoder,
data,
headerChunk,
- Create a ticketCreate a ticket
Function compare
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
compare: function (comparison, flagField) {
var flagFieldIndexA, dataIndexA,
flagFieldIndexB, dataIndexB,
x, y, delta,
- Create a ticketCreate a ticket
Function loadDOMNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadDOMNode (inputNode, parentNode) {
var nodes, length, offset, newNode;
if (capturedTags.indexOf(inputNode.tagName) !== -1) {
- Create a ticketCreate a ticket
Function _compare
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_compare: function (imageA, imageB, imageOutput, deltaThreshold, outputMaskColor, outputShiftColor, backgroundColor, hShift, vShift, perceptual, gamma) {
var result = {
code: BlinkDiff.RESULT_UNKNOWN,
differences: undefined,
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (this._gamma || this._gammaR || this._gammaG || this._gammaB) {
gamma = {
r: this._gammaR || this._gamma, g: this._gammaG || this._gamma, b: this._gammaB || this._gamma
};
}
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (this._gamma || this._gammaR || this._gammaG || this._gammaB) {
gamma = {
r: this._gammaR || this._gamma, g: this._gammaG || this._gamma, b: this._gammaB || this._gamma
};
}
- Create a ticketCreate a ticket
Function _shiftCompare
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
_shiftCompare: function (x, y, colorIndex, comparison, imageSrc, areaSrc, imageDst, areaDst) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ((Math.abs(delta - localDeltaThreshold) < deltaThreshold) && (localDeltaThreshold > deltaThreshold)) {
return true;
}
- Create a ticketCreate a ticket
Function getSelector
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getSelector: function (suffix) {
var id = this.getId(),
tagName = this.getTagName(),
classes = this.getClasses(),
- 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
Avoid deeply nested control flow statements. Open
if ((Math.abs(delta - localDeltaThreshold) < deltaThreshold) &&
(localDeltaThreshold > deltaThreshold)) {
return true;
}
- Create a ticketCreate a ticket
Function _correctGamma
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_correctGamma: function (color, gamma) {
// Convert to range [0, 1]
var result = {
c1: color.c1 / 255, c2: color.c2 / 255, c3: color.c3 / 255, c4: color.c4
- 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 processImage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
processImage: function (comparison) {
if (comparison.hasGamma && comparison.hasGamma()) {
this.applyGamma(comparison.getGamma())
}
- 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 _clip
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_clip: function (imageA, imageB) {
var minWidth, minHeight;
if ((imageA.getWidth() != imageB.getWidth()) || (imageA.getHeight() != imageB.getHeight())) {
- 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 createComposition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
createComposition: function (imageA, imageB, imageOutput) {
var width, height, image = imageOutput;
if (!this.isCompositionOff()) {
- 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 BlinkDiff
has a Cognitive Complexity of 6 (exceeds 5 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.");
- 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"