Showing 200 of 405 total issues
Function write
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
Function write
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
Function bidirectionalIndexOf
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
Function bidirectionalIndexOf
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
Function write
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
InternalDecoderCesu8.prototype.write = function(buf) {
var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes,
res = '';
for (var i = 0; i < buf.length; i++) {
var curByte = buf[i];
Function write
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Utf7Decoder.prototype.write = function(buf) {
var res = "", lastI = 0,
inBase64 = this.inBase64,
base64Accum = this.base64Accum;
Function write
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Utf7IMAPDecoder.prototype.write = function(buf) {
var res = "", lastI = 0,
inBase64 = this.inBase64,
base64Accum = this.base64Accum;
Function write
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Utf7IMAPEncoder.prototype.write = function(str) {
var inBase64 = this.inBase64,
base64Accum = this.base64Accum,
base64AccumIdx = this.base64AccumIdx,
buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
Function forOrder
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
bestGlobals.forOrder = function forOrder(text){
if(text==null){
return 'zzz(null)';
}
if(text instanceof Date){
Function _addDecodeChunk
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DBCSCodec.prototype._addDecodeChunk = function(chunk) {
// First element of chunk is the hex mbcs code where we start.
var curAddr = parseInt(chunk[0], 16);
// Choose the decoding node where we'll write our chars.
Function 21
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"safer-buffer":25}],21:[function(require,module,exports){
"use strict";
var BOMChar = '\uFEFF';
Function byteLength
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (isArrayBufferView(string) || isArrayBuffer(string)) {
Function byteLength
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (isArrayBufferView(string) || isArrayBuffer(string)) {
Function processDirectory
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function processDirectory(srcDir, destDir, only) {
return Promise.resolve().then(function() {
return fs.readdir(srcDir)
}).then(function(files) {
return Promise.all(files.map(function(file) {
Function isBoolean
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
function isBoolean(column, rows) {
if(!txtToSql.detectBooleans){
return false;
}
var vals=[];
- Read upRead up
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 isBoolean
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
function isBoolean(column, rows) {
if(!txtToSql.detectBooleans){
return false;
}
var vals=[];
- Read upRead up
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 verifyInputParams
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function verifyInputParams(info){
info.opts = changing(txtToSql.defaultOpts, info.opts || {});
txtToSql.detectBooleans = info.opts.detectBooleans;
info.messages=txtToSql.dictionary[info.opts.lang];
var errors=[];
Function copy
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
Function toByteArray
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
Function toByteArray
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]