Showing 200 of 405 total issues
Function write
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
Function verifyInputParams
has a Cognitive Complexity of 16 (exceeds 5 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=[];
- 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 a Cognitive Complexity of 16 (exceeds 5 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=[];
- 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 doFast
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function doFast(params, inputBase, fastBufferingThreshold, outputStream) {
var inStream, outStream;
var rl;
var preparedResult;
return Promise.resolve().then(function() {
Function write
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DBCSDecoder.prototype.write = function(buf) {
var newBuf = Buffer.alloc(buf.length*2),
nodeIdx = this.nodeIdx,
prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,
seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.
Function 24
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],24:[function(require,module,exports){
/* eslint-disable node/no-deprecated-api */
var buffer = require('buffer')
var Buffer = buffer.Buffer
Consider simplifying this complex logical expression. Open
Open
if(h<0 || m<0 || s<0 || ms<0 || h>23 || m>59 || s>59 || ms>999 || micros<0 || micros>999) { return false; }
Function DBCSCodec
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DBCSCodec(codecOptions, iconv) {
this.encodingName = codecOptions.encodingName;
if (!codecOptions)
throw new Error("DBCS codec is called without the data.")
if (!codecOptions.table)
Function arrayIndexOf
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
Function arrayIndexOf
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
Function 8
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"safer-buffer":25,"string_decoder":26}],8:[function(require,module,exports){
"use strict";
var Buffer = require("safer-buffer").Buffer;
// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
Function fill
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
Function fill
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
Function compare
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
Function compare
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
Function slowToString
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
Function fixLines
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
txtToSql.fixLines = function fixLines(info, lines) {
var errors=[];
var numColumns = info.columnsInfo.length;
var ln=0;
var linesJoined=0;
Function slowToString
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
Function toHtmlDoc
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
HtmlBase.prototype.toHtmlDoc=function toHtmlDoc(opts,recurseOpts){
opts = opts||{};
var html = jsToHtml.html;
var target=this;
if(!opts.incomplete){
Function fixLines
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
txtToSql.fixLines = function fixLines(info, lines) {
var errors=[];
var numColumns = info.columnsInfo.length;
var ln=0;
var linesJoined=0;