Showing 66 of 322 total issues
Function getBlurPixelAtIndex
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getBlurPixelAtIndex: function (idx, funcName) {
var colors = 0,
colorCounter = 0,
fn,
- 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 finalizeDecode
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
finalizeDecode: function (image, strict, options) {
var i, len,
imageStream, outputStream,
r, g, b, a,
- 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 _determineWriter
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Normalizer.prototype._determineWriter = function () {
var headerChunk = this.getHeaderChunk(),
isColor, hasAlpha, isIndexed,
result = null;
- Create a ticketCreate a ticket
Function postDecode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
postDecode: function (image, strict, options) {
var i, len, index, alpha,
color, colors, colorsLength,
imageStream, outputStream,
- Create a ticketCreate a ticket
Function _parse1bit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Parser.prototype._parse1bit = function (paddingAt) {
var byteCounter = 0;
return function (value, output) {
- Create a ticketCreate a ticket
Function postDecode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
postDecode: function (image, strict, options) {
var i, len,
imageStream, outputStream,
backgroundColor,
- Create a ticketCreate a ticket
Function compose
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
compose: function (stream, options) {
var headerChunk, paletteChunk,
colorType, color,
i,
- Create a ticketCreate a ticket
Function decode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
decode: function (image, strict, options) {
var i, len, index,
r, g, b, alpha,
headerChunk,
- Create a ticketCreate a ticket
Function processPasses
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Interlace.prototype.processPasses = function (cb) {
var headerChunk = this.getHeaderChunk(),
height = headerChunk.getHeight(),
- Create a ticketCreate a ticket
Function _adam7
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Interlace.prototype._adam7 = function (data, width, height, revert) {
// Suggested implementation from the spec:
// http://www.libpng.org/pub/png/spec/1.1/PNG-Decoders.html
- 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 compose
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
compose: function (stream, options) {
var headerChunk, paletteChunk,
colorType, color,
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 _parseChunk
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Decoder.prototype._parseChunk = function (stream, strict, options) {
var chunkLength,
chunkType,
chunkCrc,
- Create a ticketCreate a ticket
Function _optimalEncode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Filter.prototype._optimalEncode = function (info, options) {
var filterList = [4, 3, 2, 1, 0],
filterType,
filterMapping,
- Create a ticketCreate a ticket
Function preEncode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
preEncode: function (image, options) {
var imageStream, scaledStream, reducedStream, withdrawnStream,
interlace;
- Create a ticketCreate a ticket
Function encodeData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
encodeData: function (image, options) {
if (options.chromaticities) {
var chunk = this.createChunk(this.getType(), this.getChunks());
- Create a ticketCreate a ticket
Function finalizeDecode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
finalizeDecode: function (image, strict, options) {
var i, len,
imageStream, outputStream,
r, g, b, a,
- Create a ticketCreate a ticket
Function applyFilters
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
applyFilters: function (filters, returnResult) {
var image,
newFilters;
- Create a ticketCreate a ticket
Function encode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Encoder.prototype.encode = function (image, width, height, options) {
options = options || {};
var i, len,
- Create a ticketCreate a ticket
Function decode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Parser.prototype.decode = function (image) {
var headerChunk = this.getHeaderChunk(),
interlace = new Interlace(headerChunk),
- Create a ticketCreate a ticket
Function parse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function (stream, length, strict, options) {
var i, len,
foundIndex = null,
buffer, string,
- Create a ticketCreate a ticket