File jszip.js
has 4894 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
JSZip - A Javascript class for generating and reading zip files
<http://stuartk.com/jszip>
Function 35
has 959 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],35:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('../utils/common');
Function 32
has 894 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],32:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('../utils/common');
var trees = _dereq_('./trees');
Function inflate
has 774 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 */
Function 13
has 500 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./uint8ArrayReader":18}],13:[function(_dereq_,module,exports){
'use strict';
var support = _dereq_('./support');
var utils = _dereq_('./utils');
var crc32 = _dereq_('./crc32');
Function 38
has 455 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],38:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('../utils/common');
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 ||
Function 21
has 218 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(_dereq_,module,exports){
'use strict';
var support = _dereq_('./support');
var compressions = _dereq_('./compressions');
var nodeBuffer = _dereq_('./nodeBuffer');
Function 23
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./nodeBufferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(_dereq_,module,exports){
'use strict';
var StringReader = _dereq_('./stringReader');
var utils = _dereq_('./utils');
var CompressedObject = _dereq_('./compressedObject');
Function 34
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],34:[function(_dereq_,module,exports){
'use strict';
// See state defs from inflate.js
var BAD = 30; /* got a data error -- remain here until reset */
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 */
Function 36
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../utils/common":27,"./adler32":29,"./crc32":31,"./inffast":34,"./inftrees":36}],36:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('../utils/common');
Function 22
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){
'use strict';
var StringReader = _dereq_('./stringReader');
var NodeBufferReader = _dereq_('./nodeBufferReader');
var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
Function 25
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./lib/deflate":25,"./lib/inflate":26,"./lib/utils/common":27,"./lib/zlib/constants":30}],25:[function(_dereq_,module,exports){
'use strict';
var zlib_deflate = _dereq_('./zlib/deflate.js');
Function 26
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(_dereq_,module,exports){
'use strict';
var zlib_inflate = _dereq_('./zlib/inflate.js');
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 */
Function 20
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./utils":21}],20:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('./utils');
var support = _dereq_('./support');
Function 28
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],28:[function(_dereq_,module,exports){
// String encode/decode helpers
'use strict';
Function generateZipParts
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
var generateZipParts = function(name, file, compressedObject, offset, platform) {
var data = compressedObject.compressedContent,
utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)),
comment = file.comment || "",
utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)),
Function 4
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./flate":8}],4:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('./utils');
Function generate
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
generate: function(options) {
options = extend(options || {}, {
base64: true,
compression: "STORE",
compressionOptions : null,
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;
Function 27
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(_dereq_,module,exports){
'use strict';
var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
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 (;;) {
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] &&
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 */
Function 5
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./utils":21}],5:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('./utils');
function DataReader(data) {
Function push
has 50 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 status, _mode;
var next_out_utf8, tail, utf8str;
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 */
Function 1
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSZip=e()}}(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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(_dereq_,module,exports){
'use strict';
// private property
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
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;
Function fileAdd
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var fileAdd = function(name, data, o) {
// be sure sub folders exist
var dataType = utils.getTypeOf(data),
parent;
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");
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;
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 */
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++) {
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);
}
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;
Function arrayLikeToString
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function arrayLikeToString(array) {
// Performances notes :
// --------------------
// String.fromCharCode.apply(null, array) is the fastest, see
// see http://jsperf.com/converting-a-uint8array-to-a-string/2
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++) {
Function push
has 38 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;
Function 7
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],7:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('./utils');
/**
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 */
{
Function Deflate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Deflate = function(options) {
this.options = utils.assign({
level: Z_DEFAULT_COMPRESSION,
method: Z_DEFLATED,
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. */
Function 9
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"pako":24}],9:[function(_dereq_,module,exports){
'use strict';
var base64 = _dereq_('./base64');
Function 18
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],18:[function(_dereq_,module,exports){
'use strict';
var DataReader = _dereq_('./dataReader');
function Uint8ArrayReader(data) {
Function Inflate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Inflate = function(options) {
this.options = utils.assign({
chunkSize: 16384,
windowBits: 0,
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 */
Function generateCompressedObjectFrom
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var generateCompressedObjectFrom = function(file, compression, compressionOptions) {
var result = new CompressedObject(),
content;
// the data has not been decompressed, we might reuse things !
Function readEndOfCentral
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
readEndOfCentral: function() {
var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
if (offset === -1) {
// Check if the content is a truncated zip or complete garbage.
// A "LOCAL_FILE_HEADER" is not required at the beginning (auto
Function 17
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./utils":21}],17:[function(_dereq_,module,exports){
(function (Buffer){
'use strict';
exports.base64 = true;
exports.array = true;
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)
Function 30
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],30:[function(_dereq_,module,exports){
module.exports = {
/* Allowed flush values; see deflate() and inflate() below for details */
Z_NO_FLUSH: 0,
Function 10
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(_dereq_,module,exports){
'use strict';
var base64 = _dereq_('./base64');
var ZipEntries = _dereq_('./zipEntries');
module.exports = function(data, options) {
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;
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 */
Function readLocalPart
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
readLocalPart: function(reader) {
var compression, localExtraFieldsLength;
// we already know everything from the central dir !
// If the central dir data are false, we are doomed.
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 */
{
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)
Consider simplifying this complex logical expression. Open
if (status !== INIT_STATE &&
status !== EXTRA_STATE &&
status !== NAME_STATE &&
status !== COMMENT_STATE &&
status !== HCRC_STATE &&
Function deflateInit2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
Avoid deeply nested control flow statements. Open
if (s.pending === s.pending_buf_size) {
val = 1;
break;
}
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;
}
Avoid deeply nested control flow statements. Open
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break;
}
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);
}
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
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;
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
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; }
Avoid deeply nested control flow statements. Open
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
Avoid deeply nested control flow statements. Open
while (copy--) {
state.lens[state.have++] = len;
}
Avoid deeply nested control flow statements. Open
if ((last_bits + here_bits) <= bits) { break; }
Avoid deeply nested control flow statements. Open
if (s.pending === s.pending_buf_size) {
break;
}
Avoid deeply nested control flow statements. Open
if (s.pending === s.pending_buf_size) {
val = 1;
break;
}
Avoid deeply nested control flow statements. Open
if (state.head && len &&
(state.length < 65536 /*state.head.comm_max*/)) {
state.head.comment += String.fromCharCode(len);
}
Avoid deeply nested control flow statements. Open
if (s.lookahead === 0) {
s.strstart = 0;
s.block_start = 0;
s.insert = 0;
}
Avoid deeply nested control flow statements. Open
if (state.head && len &&
(state.length < 65536 /*state.head.name_max*/)) {
state.head.name += String.fromCharCode(len);
}
Avoid deeply nested control flow statements. Open
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
}
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);
Avoid deeply nested control flow statements. Open
if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
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);
}
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
Avoid deeply nested control flow statements. Open
if ((last_bits + here_bits) <= bits) { break; }
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
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);
}
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
Avoid deeply nested control flow statements. Open
if ((here_bits) <= bits) { break; }
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
Avoid deeply nested control flow statements. Open
if (have === 0) { break inf_leave; }
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
Function Config
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var Config = function (good_length, max_lazy, nice_length, max_chain, func) {
Function generateZipParts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var generateZipParts = function(name, file, compressedObject, offset, platform) {
Function arraySet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
arraySet: function (dest, src, src_offs, len, dest_offs) {
Function prepareContent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
prepareContent: function(reader, from, length, compression, uncompressedSize) {
Function StaticTreeDesc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var StaticTreeDesc = function (static_tree, extra_bits, extra_base, elems, max_length) {
Function arraySet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
arraySet: function (dest, src, src_offs, len, dest_offs) {
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
Avoid too many return
statements within this function. Open
return BS_FINISH_DONE;
Avoid too many return
statements within this function. Open
return err(strm, Z_BUF_ERROR);
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
Avoid too many return
statements within this function. Open
return BS_BLOCK_DONE;
Avoid too many return
statements within this function. Open
return Z_OK;
Avoid too many return
statements within this function. Open
if (s.wrap <= 0) { return Z_STREAM_END; }
Avoid too many return
statements within this function. Open
return "arraybuffer";
Avoid too many return
statements within this function. Open
return s.pending !== 0 ? Z_OK : Z_STREAM_END;
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
Avoid too many return
statements within this function. Open
return BS_BLOCK_DONE;
Avoid too many return
statements within this function. Open
return BS_BLOCK_DONE;
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return BS_FINISH_DONE;
Avoid too many return
statements within this function. Open
return Z_OK;
Avoid too many return
statements within this function. Open
return BS_NEED_MORE;
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return BS_BLOCK_DONE;
Avoid too many return
statements within this function. Open
if (flush !== Z_FINISH) { return Z_OK; }
TODO found Open
// TODO: may be {}
- Exclude checks
TODO found Open
// TODO: 2 or 1 bytes?
- Exclude checks
TODO found Open
// internal file attributes TODO
- Exclude checks
Identical blocks of code found in 3 locations. Consider refactoring. Open
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSZip=e()}}(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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(_dereq_,module,exports){
'use strict';
// private property
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- Read upRead up
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 62267.
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