File jszip.js
has 6421 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
JSZip v3.1.3 - A Javascript class for generating and reading zip files
<http://stuartk.com/jszip>
- Create a ticketCreate a ticket
Function 70
has 984 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],70:[function(require,module,exports){
'use strict';
var utils = require('../utils/common');
- Create a ticketCreate a ticket
Function 67
has 957 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],67:[function(require,module,exports){
'use strict';
var utils = require('../utils/common');
var trees = require('./trees');
- Create a ticketCreate a ticket
Function inflate
has 775 lines of code (exceeds 25 allowed). Consider refactoring. Open
function inflate(strm, flush) {
var state;
var input, output; // input/output buffers
var next; /* next input INDEX */
var put; /* next output INDEX */
- Create a ticketCreate a ticket
Function 73
has 455 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],73:[function(require,module,exports){
'use strict';
var utils = require('../utils/common');
- Create a ticketCreate a ticket
Function 8
has 295 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./stream/GenericWorker":28,"./utils":32,"pako":59}],8:[function(require,module,exports){
'use strict';
var utils = require('../utils');
var GenericWorker = require('../stream/GenericWorker');
- Create a ticketCreate a ticket
Function 32
has 293 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(require,module,exports){
'use strict';
var support = require('./support');
var base64 = require('./base64');
- Create a ticketCreate a ticket
Function deflate
has 256 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deflate(strm, flush) {
var old_flush, s;
var beg, val; // for gzip header write only
if (!strm || !strm.state ||
- Create a ticketCreate a ticket
Function 15
has 224 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],15:[function(require,module,exports){
'use strict';
var utf8 = require('./utf8');
var utils = require('./utils');
var GenericWorker = require('./stream/GenericWorker');
- Create a ticketCreate a ticket
Function 58
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],58:[function(require,module,exports){
'use strict';
var immediate = require('immediate');
/* istanbul ignore next */
- Create a ticketCreate a ticket
Function 69
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],69:[function(require,module,exports){
'use strict';
// See state defs from inflate.js
var BAD = 30; /* got a data error -- remain here until reset */
- Create a ticketCreate a ticket
Function 34
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(require,module,exports){
'use strict';
var readerFor = require('./reader/readerFor');
var utils = require('./utils');
var CompressedObject = require('./compressedObject');
- Create a ticketCreate a ticket
Function inflate_fast
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function inflate_fast(strm, start) {
var state;
var _in; /* local strm.input */
var last; /* have enough input while in < last */
var _out; /* local strm.output */
- Create a ticketCreate a ticket
Function 31
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"readable-stream":16}],31:[function(require,module,exports){
'use strict';
var utils = require('./utils');
var support = require('./support');
- Create a ticketCreate a ticket
Function 33
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"core-js/library/fn/set-immediate":36}],33:[function(require,module,exports){
'use strict';
var readerFor = require('./reader/readerFor');
var utils = require('./utils');
var sig = require('./signature');
- Create a ticketCreate a ticket
Function 61
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./utils/common":62,"./utils/strings":63,"./zlib/deflate":67,"./zlib/messages":72,"./zlib/zstream":74}],61:[function(require,module,exports){
'use strict';
var zlib_inflate = require('./zlib/inflate');
- Create a ticketCreate a ticket
Function 60
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./lib/deflate":60,"./lib/inflate":61,"./lib/utils/common":62,"./lib/zlib/constants":65}],60:[function(require,module,exports){
'use strict';
var zlib_deflate = require('./zlib/deflate');
- Create a ticketCreate a ticket
Function 71
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../utils/common":62,"./adler32":64,"./crc32":66,"./inffast":69,"./inftrees":71}],71:[function(require,module,exports){
'use strict';
var utils = require('../utils/common');
- Create a ticketCreate a ticket
Function 28
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../utils":32,"./GenericWorker":28}],28:[function(require,module,exports){
'use strict';
/**
* A worker that does nothing but passing chunks to the next one. This is like
- Create a ticketCreate a ticket
Function 29
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],29:[function(require,module,exports){
'use strict';
var utils = require('../utils');
var ConvertWorker = require('./ConvertWorker');
- Create a ticketCreate a ticket
Function inflate_table
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
{
var bits = opts.bits;
//here = opts.here; /* table entry for duplication */
- Create a ticketCreate a ticket
Function 63
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],63:[function(require,module,exports){
// String encode/decode helpers
'use strict';
- Create a ticketCreate a ticket
Function generateZipParts
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
var generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) {
var file = streamInfo['file'],
compression = streamInfo['compression'],
useCustomEncoding = encodeFileName !== utf8.utf8encode,
encodedFileName = utils.transformTo("string", encodeFileName(file.name)),
- Create a ticketCreate a ticket
Function 27
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../utils":32,"./GenericWorker":28}],27:[function(require,module,exports){
'use strict';
var utils = require('../utils');
var GenericWorker = require('./GenericWorker');
- Create a ticketCreate a ticket
Function deflate_slow
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deflate_slow(s, flush) {
var hash_head; /* head of hash chain */
var bflush; /* set if current block must be flushed */
var max_insert;
- Create a ticketCreate a ticket
Function push
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Inflate.prototype.push = function (data, mode) {
var strm = this.strm;
var chunkSize = this.options.chunkSize;
var dictionary = this.options.dictionary;
var status, _mode;
- Create a ticketCreate a ticket
Function 35
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(require,module,exports){
'use strict';
var StreamHelper = require('./stream/StreamHelper');
var DataWorker = require('./stream/DataWorker');
- Create a ticketCreate a ticket
Function 62
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./utils/common":62,"./utils/strings":63,"./zlib/constants":65,"./zlib/gzheader":68,"./zlib/inflate":70,"./zlib/messages":72,"./zlib/zstream":74}],62:[function(require,module,exports){
'use strict';
var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
- Create a ticketCreate a ticket
Function 11
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(require,module,exports){
'use strict';
var utils = require('./utils');
var external = require("./external");
var utf8 = require('./utf8');
- Create a ticketCreate a ticket
Function 1
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.JSZip = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var utils = require('./utils');
var support = require('./support');
// private property
- Create a ticketCreate a ticket
Function 54
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],54:[function(require,module,exports){
var ctx = require('./_ctx')
, invoke = require('./_invoke')
, html = require('./_html')
, cel = require('./_dom-create')
- Create a ticketCreate a ticket
Function 57
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./_export":44,"./_task":54}],57:[function(require,module,exports){
(function (global){
'use strict';
var Mutation = global.MutationObserver || global.WebKitMutationObserver;
- Create a ticketCreate a ticket
Function deflate_fast
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deflate_fast(s, flush) {
var hash_head; /* head of the hash chain */
var bflush; /* set if current block must be flushed */
for (;;) {
- Create a ticketCreate a ticket
Function deflateSetDictionary
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deflateSetDictionary(strm, dictionary) {
var dictLength = dictionary.length;
var s;
var str, n;
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
strend = s.strstart + MAX_MATCH;
do {
/*jshint noempty:false*/
} while (prev === _win[++scan] && prev === _win[++scan] &&
- Create a ticketCreate a ticket
Function deflate_rle
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deflate_rle(s, flush) {
var bflush; /* set if current block must be flushed */
var prev; /* byte at distance one to match */
var scan, strend; /* scan goes up to strend for length of run */
- Create a ticketCreate a ticket
Function 18
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../utils":32,"./DataReader":18}],18:[function(require,module,exports){
'use strict';
var utils = require('../utils');
function DataReader(data) {
- Create a ticketCreate a ticket
Function 12
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(require,module,exports){
"use strict";
var utils = require('../utils');
var GenericWorker = require('../stream/GenericWorker');
- Create a ticketCreate a ticket
Function Deflate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Deflate(options) {
if (!(this instanceof Deflate)) return new Deflate(options);
this.options = utils.assign({
level: Z_DEFAULT_COMPRESSION,
- Create a ticketCreate a ticket
Function 44
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./_global":46,"./_is-object":51}],44:[function(require,module,exports){
var global = require('./_global')
, core = require('./_core')
, ctx = require('./_ctx')
, hide = require('./_hide')
- Create a ticketCreate a ticket
Function tr_static_init
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tr_static_init() {
var n; /* iterates over tree elements */
var bits; /* bit counter */
var length; /* length value */
var code; /* code value */
- Create a ticketCreate a ticket
Function deflate_stored
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deflate_stored(s, flush) {
/* Stored blocks are limited to 0xffff bytes, pending_buf is limited
* to pending_buf_size, and each stored block has a 5 byte header:
*/
var max_block_size = 0xffff;
- Create a ticketCreate a ticket
Function readEndOfCentral
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
readEndOfCentral: function() {
var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
if (offset < 0) {
// Check if the content is a truncated zip or complete garbage.
// A "LOCAL_FILE_HEADER" is not required at the beginning (auto
- Create a ticketCreate a ticket
Function exports
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(data, options) {
var zip = this;
options = utils.extend(options || {}, {
base64: false,
checkCRC32: false,
- Create a ticketCreate a ticket
Function push
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Deflate.prototype.push = function (data, mode) {
var strm = this.strm;
var chunkSize = this.options.chunkSize;
var status, _mode;
- Create a ticketCreate a ticket
Function fileAdd
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var fileAdd = function(name, data, originalOptions) {
// be sure sub folders exist
var dataType = utils.getTypeOf(data),
parent;
- Create a ticketCreate a ticket
Function deflateInit2
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
if (!strm) { // === Z_NULL
return Z_STREAM_ERROR;
}
var wrap = 1;
- Create a ticketCreate a ticket
Function fill_window
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fill_window(s) {
var _w_size = s.w_size;
var p, n, m, more, str;
//Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
- Create a ticketCreate a ticket
Function longest_match
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function longest_match(s, cur_match) {
var chain_length = s.max_chain_length; /* max hash chain length */
var scan = s.strstart; /* current string */
var match; /* matched string */
var len; /* length of current match */
- Create a ticketCreate a ticket
Function 2
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./support":30,"./utils":32}],2:[function(require,module,exports){
'use strict';
var external = require("./external");
var DataWorker = require('./stream/DataWorker');
- Create a ticketCreate a ticket
Function string2buf
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var string2buf = function (str) {
var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
// count binary size
for (m_pos = 0; m_pos < str_len; m_pos++) {
- Create a ticketCreate a ticket
Function 17
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"stream":undefined}],17:[function(require,module,exports){
'use strict';
var DataReader = require('./DataReader');
var utils = require('../utils');
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
strategy < 0 || strategy > Z_FIXED) {
return err(strm, Z_STREAM_ERROR);
}
- Create a ticketCreate a ticket
Function decode
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.decode = function(input) {
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0, resultIndex = 0;
- Create a ticketCreate a ticket
Function gen_bitlen
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function gen_bitlen(s, desc)
// deflate_state *s;
// tree_desc *desc; /* the tree descriptor */
{
var tree = desc.dyn_tree;
- Create a ticketCreate a ticket
Function 7
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"lie":58}],7:[function(require,module,exports){
'use strict';
var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');
var pako = require("pako");
- Create a ticketCreate a ticket
Function 4
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./flate":7,"./stream/GenericWorker":28}],4:[function(require,module,exports){
'use strict';
var utils = require('./utils');
- Create a ticketCreate a ticket
Function generateInternalStream
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateInternalStream: function(options) {
var worker, opts = {};
try {
opts = utils.extend(options || {}, {
streamFiles: false,
- Create a ticketCreate a ticket
Function string2buf
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.string2buf = function (str) {
var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
// count binary size
for (m_pos = 0; m_pos < str_len; m_pos++) {
- Create a ticketCreate a ticket
Function prepareContent
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) {
// if inputData is already a promise, this flatten it.
var promise = external.Promise.resolve(inputData).then(function(data) {
- Create a ticketCreate a ticket
Function send_tree
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function send_tree(s, tree, max_code)
// deflate_state *s;
// ct_data *tree; /* the tree to be scanned */
// int max_code; /* and its largest code of non zero frequency */
{
- Create a ticketCreate a ticket
Function 9
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(require,module,exports){
'use strict';
var compressions = require('../compressions');
var ZipFileWorker = require('./ZipFileWorker');
- Create a ticketCreate a ticket
Function Inflate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Inflate(options) {
if (!(this instanceof Inflate)) return new Inflate(options);
this.options = utils.assign({
chunkSize: 16384,
- Create a ticketCreate a ticket
Function $export
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $export = function(type, name, source){
var IS_FORCED = type & $export.F
, IS_GLOBAL = type & $export.G
, IS_STATIC = type & $export.S
, IS_PROTO = type & $export.P
- Create a ticketCreate a ticket
Function deflate_huff
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deflate_huff(s, flush) {
var bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we have a literal to write. */
- Create a ticketCreate a ticket
Function 30
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(require,module,exports){
'use strict';
exports.base64 = true;
exports.array = true;
- Create a ticketCreate a ticket
Function updatewindow
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updatewindow(strm, src, end, copy) {
var dist;
var state = strm.state;
/* if it hasn't been done already, allocate space for the window */
- Create a ticketCreate a ticket
Function all
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function all(iterable) {
var self = this;
if (Object.prototype.toString.call(iterable) !== '[object Array]') {
return this.reject(new TypeError('must be an array'));
}
- Create a ticketCreate a ticket
Function 10
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../compressions":3,"./ZipFileWorker":8}],10:[function(require,module,exports){
'use strict';
/**
* Representation a of zip file in js
- Create a ticketCreate a ticket
Function buf2string
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var buf2string = function (buf) {
var str, i, out, c, c_len;
var len = buf.length;
// Reserve max possible length (2 words per char)
- Create a ticketCreate a ticket
Function 65
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],65:[function(require,module,exports){
'use strict';
module.exports = {
- Create a ticketCreate a ticket
Function _tick
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
DataWorker.prototype._tick = function() {
if(this.isPaused || this.isFinished) {
return false;
}
- Create a ticketCreate a ticket
Function race
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function race(iterable) {
var self = this;
if (Object.prototype.toString.call(iterable) !== '[object Array]') {
return this.reject(new TypeError('must be an array'));
}
- Create a ticketCreate a ticket
Function accumulate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function accumulate(helper, updateCallback) {
return new external.Promise(function (resolve, reject){
var dataArray = [];
var chunkType = helper._internalType,
resultType = helper._outputType,
- Create a ticketCreate a ticket
Function processChunk
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Utf8DecodeWorker.prototype.processChunk = function (chunk) {
var data = utils.transformTo(support.uint8array ? "uint8array" : "array", chunk.data);
// 1st step, re-use what's left of the previous chunk
- Create a ticketCreate a ticket
Function 13
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../stream/GenericWorker":28,"../utils":32}],13:[function(require,module,exports){
'use strict';
var Readable = require('readable-stream').Readable;
- Create a ticketCreate a ticket
Function _bindStream
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
NodejsStreamInputAdapter.prototype._bindStream = function (stream) {
var self = this;
this._stream = stream;
stream.pause();
stream
- Create a ticketCreate a ticket
Function build_tree
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function build_tree(s, desc)
// deflate_state *s;
// tree_desc *desc; /* the tree descriptor */
{
var tree = desc.dyn_tree;
- Create a ticketCreate a ticket
Function scan_tree
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function scan_tree(s, tree, max_code)
// deflate_state *s;
// ct_data *tree; /* the tree to be scanned */
// int max_code; /* and its largest code of non zero frequency */
{
- Create a ticketCreate a ticket
Function _tr_flush_block
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _tr_flush_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf; /* input block, or NULL if too old */
//ulg stored_len; /* length of input block */
//int last; /* one if this is the last block for a file */
- Create a ticketCreate a ticket
Function exports
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (status !== INIT_STATE &&
status !== EXTRA_STATE &&
status !== NAME_STATE &&
status !== COMMENT_STATE &&
status !== HCRC_STATE &&
- Create a ticketCreate a ticket
Function deflateInit2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
- Create a ticketCreate a ticket
Function generateZipParts
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
var generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (s.pending === s.pending_buf_size) {
break;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ((last_bits + here_bits) <= bits) { break; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (s.pending === s.pending_buf_size) {
val = 1;
break;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (state.head && len &&
(state.length < 65536 /*state.head.comm_max*/)) {
state.head.comment += String.fromCharCode(len);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (op & 16) { /* distance base */
dist = here & 0xffff/*here.val*/;
op &= 15; /* number of extra bits */
if (bits < op) {
hold += input[_in++] << bits;
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (s.pending === s.pending_buf_size) {
val = 1;
break;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (state.head) {
len = state.head.extra_len - state.length;
if (!state.head.extra) {
// Use untyped array for more conveniend processing later
state.head.extra = new Array(state.head.extra_len);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (state.have + copy > state.nlen + state.ndist) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
break;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (s.lookahead === 0) {
s.strstart = 0;
s.block_start = 0;
s.insert = 0;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (state.head && len &&
(state.length < 65536 /*state.head.name_max*/)) {
state.head.name += String.fromCharCode(len);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ((last_bits + here_bits) <= bits) { break; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
while (copy--) {
state.lens[state.have++] = len;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ((here_bits) <= bits) { break; }
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (here_val === 16) {
//=== NEEDBITS(here.bits + 2);
n = here_bits + 2;
while (bits < n) {
if (have === 0) { break inf_leave; }
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) {
this.zip64 = true;
/*
Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from
- Create a ticketCreate a ticket
Function CompressedObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) {
- Create a ticketCreate a ticket
Function StaticTreeDesc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
- Create a ticketCreate a ticket
Function generateCentralDirectoryEnd
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var generateCentralDirectoryEnd = function (entriesCount, centralDirLength, localDirLength, comment, encodeFileName) {
- Create a ticketCreate a ticket
Function arraySet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
arraySet: function (dest, src, src_offs, len, dest_offs) {
- Create a ticketCreate a ticket
Function prepareContent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) {
- Create a ticketCreate a ticket
Function Config
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Config(good_length, max_lazy, nice_length, max_chain, func) {
- Create a ticketCreate a ticket
Function arraySet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
arraySet: function (dest, src, src_offs, len, dest_offs) {
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return err(strm, Z_BUF_ERROR);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_FINISH_DONE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return Z_OK;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (s.wrap <= 0) { return Z_STREAM_END; }
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return Z_OK;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_BLOCK_DONE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_BLOCK_DONE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_BLOCK_DONE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "arraybuffer";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_BLOCK_DONE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return Z_OK;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return BS_FINISH_DONE;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (flush !== Z_FINISH) { return Z_OK; }
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return s.pending !== 0 ? Z_OK : Z_STREAM_END;
- Create a ticketCreate a ticket
Identical blocks of code found in 3 locations. Consider refactoring. Open
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.JSZip = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var utils = require('./utils');
var support = require('./support');
// private property
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 78010.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76