Showing 66 of 322 total issues
Function setAtIndex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
setAtIndex: function (idx, color) {
if (typeof color === 'object') {
if (color.red !== undefined) this.setRed(idx, color.red, color.opacity);
if (color.green !== undefined) this.setGreen(idx, color.green, color.opacity);
if (color.blue !== undefined) this.setBlue(idx, color.blue, color.opacity);
- 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 BufferedStream
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var BufferedStream = function (data, offset, length) {
this.readOffset = 0;
this.writeOffset = 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 preEncode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
preEncode: function (image, options) {
var imageStream, scaledStream, reducedStream, withdrawnStream,
interlace;
- 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 addEncodeTests
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
addEncodeTests: function (options) {
before(function () {
this.file = this.resource(options.resourceGroup, options.resourceFile + '.raw');
this.finalFile = this.resource((options.outputGroup || options.resourceGroup), (options.outputFile || options.resourceFile) + '_enc.png');
- Create a ticketCreate a ticket
Function parse
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function (stream, length, strict, options) {
var i, len, foundIndex = null, buffer, string,
compressor,
data,
- Create a ticketCreate a ticket
Function generateBlob
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateBlob () {
var buffer = new Buffer(2 * 3 * 4);
buffer[0] = 18; // Red
- Create a ticketCreate a ticket
Function encode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Filter.prototype.encode = function (image) {
var headerChunk = this.getHeaderChunk(),
interlace = new Interlace(headerChunk),
- Create a ticketCreate a ticket
Function decode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Filter.prototype.decode = function (image) {
var headerChunk = this.getHeaderChunk(),
interlace = new Interlace(headerChunk),
- Create a ticketCreate a ticket
Function getSepiaAtIndex
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getSepiaAtIndex: function (idx) {
var r = this.getRed(idx),
g = this.getGreen(idx),
b = this.getBlue(idx);
- 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 getYIQAtIndex
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getYIQAtIndex: function (idx) {
var r = this.getRed(idx),
g = this.getGreen(idx),
b = this.getBlue(idx),
- 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 _determineScaler
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Scaler.prototype._determineScaler = function () {
var headerChunk = this.getHeaderChunk(),
isIndexed, bitDepth,
- 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 postDecode
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
postDecode: function (image, strict, options) {
var i, len, index, alpha,
color, colors, colorsLength,
imageStream, outputStream,
- 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 encodeData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
encodeData: function (image, options) {
if (options.offset) {
var chunk = this.createChunk(this.getType(), this.getChunks());
- 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 encodeData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
encodeData: function (image, options) {
if (options.physicalScale) {
var chunk = this.createChunk(this.getType(), this.getChunks());
- 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 encodeData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
encodeData: function (image, options) {
if (options.physicalSize) {
var chunk = this.createChunk(this.getType(), this.getChunks());
- 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 postDecode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
postDecode: function (image, strict, options) {
var i, len,
imageStream, outputStream,
backgroundColor,
- 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 decodeTypeData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Chunk.decodeTypeData = function (type, decodeData, chunks, strict, options) {
- Create a ticketCreate a ticket
Function fillRect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
fillRect: function (x, y, width, height, color) {
- Create a ticketCreate a ticket
Function compareBuffers
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function compareBuffers (bufferActual, bufferExpected, actualOffset, expectedOffset, length) {
- Create a ticketCreate a ticket
Function encode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this.encode = function (path, buffer, width, height, options) {
- Create a ticketCreate a ticket