codenautas/txt-to-sql

View on GitHub

Showing 200 of 405 total issues

Function write has 43 lines of code (exceeds 25 allowed). Consider refactoring.
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
Severity: Minor
Found in web/buffer.js - About 1 hr to fix

    Function write has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    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
    Severity: Minor
    Found in web/iconv-lite.js - About 1 hr to fix

      Function bidirectionalIndexOf has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
        // Empty buffer means no match
        if (buffer.length === 0) return -1
      
        // Normalize byteOffset
      Severity: Minor
      Found in web/buffer.js - About 1 hr to fix

        Function bidirectionalIndexOf has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
          // Empty buffer means no match
          if (buffer.length === 0) return -1
        
          // Normalize byteOffset
        Severity: Minor
        Found in web/iconv-lite.js - About 1 hr to fix

          Function write has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          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];
          Severity: Minor
          Found in web/iconv-lite.js - About 1 hr to fix

            Function write has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Utf7Decoder.prototype.write = function(buf) {
                var res = "", lastI = 0,
                    inBase64 = this.inBase64,
                    base64Accum = this.base64Accum;
            
            
            Severity: Minor
            Found in web/iconv-lite.js - About 1 hr to fix

              Function write has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Utf7IMAPDecoder.prototype.write = function(buf) {
                  var res = "", lastI = 0,
                      inBase64 = this.inBase64,
                      base64Accum = this.base64Accum;
              
              
              Severity: Minor
              Found in web/iconv-lite.js - About 1 hr to fix

                Function write has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                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;
                Severity: Minor
                Found in web/iconv-lite.js - About 1 hr to fix

                  Function forOrder has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  bestGlobals.forOrder = function forOrder(text){
                      if(text==null){
                          return 'zzz(null)';
                      }
                      if(text instanceof Date){
                  Severity: Minor
                  Found in web/best-globals.js - About 1 hr to fix

                    Function _addDecodeChunk has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    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.
                    Severity: Minor
                    Found in web/iconv-lite.js - About 1 hr to fix

                      Function 21 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      },{"safer-buffer":25}],21:[function(require,module,exports){
                      "use strict";
                      
                      var BOMChar = '\uFEFF';
                      
                      
                      Severity: Minor
                      Found in web/iconv-lite.js - About 1 hr to fix

                        Function byteLength has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function byteLength (string, encoding) {
                          if (Buffer.isBuffer(string)) {
                            return string.length
                          }
                          if (isArrayBufferView(string) || isArrayBuffer(string)) {
                        Severity: Minor
                        Found in web/buffer.js - About 1 hr to fix

                          Function byteLength has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function byteLength (string, encoding) {
                            if (Buffer.isBuffer(string)) {
                              return string.length
                            }
                            if (isArrayBufferView(string) || isArrayBuffer(string)) {
                          Severity: Minor
                          Found in web/iconv-lite.js - About 1 hr to fix

                            Function processDirectory has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            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) {
                            Severity: Minor
                            Found in tools/web.js - About 1 hr to fix

                              Function isBoolean has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function isBoolean(column, rows) {
                                  if(!txtToSql.detectBooleans){
                                      return false;
                                  }
                                  var vals=[];
                              Severity: Minor
                              Found in web/txt-to-sql.js - About 1 hr to fix

                              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

                              function isBoolean(column, rows) {
                                  if(!txtToSql.detectBooleans){
                                      return false;
                                  }
                                  var vals=[];
                              Severity: Minor
                              Found in lib/txt-to-sql.js - About 1 hr to fix

                              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

                              function verifyInputParams(info){
                                  info.opts = changing(txtToSql.defaultOpts, info.opts || {});
                                  txtToSql.detectBooleans = info.opts.detectBooleans;
                                  info.messages=txtToSql.dictionary[info.opts.lang];
                                  var errors=[];
                              Severity: Minor
                              Found in web/txt-to-sql.js - About 1 hr to fix

                                Function copy has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                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
                                Severity: Minor
                                Found in web/iconv-lite.js - About 1 hr to fix

                                  Function toByteArray has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function toByteArray (b64) {
                                    var tmp
                                    var lens = getLens(b64)
                                    var validLen = lens[0]
                                    var placeHoldersLen = lens[1]
                                  Severity: Minor
                                  Found in web/iconv-lite.js - About 1 hr to fix

                                    Function toByteArray has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function toByteArray (b64) {
                                      var tmp
                                      var lens = getLens(b64)
                                      var validLen = lens[0]
                                      var placeHoldersLen = lens[1]
                                    Severity: Minor
                                    Found in web/buffer.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language