lib/pixelComparator.js
Function compare
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
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
Function _shiftCompare
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
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
Function _shiftCompare
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_shiftCompare: function (x, y, colorIndex, comparison, imageSrc, areaSrc, imageDst, areaDst) {
var xOffset, xLow, xHigh,
yOffset, yLow, yHigh,
- Create a ticketCreate a ticket
Function compare
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compare: function (comparison, flagField) {
var flagFieldIndexA, dataIndexA,
flagFieldIndexB, dataIndexB,
x, y, delta,
- Create a ticketCreate a ticket
Function _shiftCompare
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_shiftCompare: function (x, y, colorIndex, comparison, imageSrc, areaSrc, imageDst, areaDst) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if ((Math.abs(delta - localDeltaThreshold) < deltaThreshold) &&
(localDeltaThreshold > deltaThreshold)) {
return true;
}
- Create a ticketCreate a ticket