codenautas/txt-to-sql

View on GitHub

Showing 200 of 405 total issues

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

Buffer.prototype.write = function write (string, offset, length, encoding) {
  // Buffer#write(string)
  if (offset === undefined) {
    encoding = 'utf8'
    length = this.length
Severity: Major
Found in web/buffer.js - About 2 hrs to fix

    Function verifyInputParams has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 a Cognitive Complexity of 16 (exceeds 5 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 lib/txt-to-sql.js - About 2 hrs 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 doFast has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function doFast(params, inputBase, fastBufferingThreshold, outputStream) {
        var inStream, outStream;
        var rl;
        var preparedResult;
        return Promise.resolve().then(function() {
    Severity: Major
    Found in bin/fast.js - About 2 hrs to fix

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

        Function 24 has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{}],24:[function(require,module,exports){
        /* eslint-disable node/no-deprecated-api */
        var buffer = require('buffer')
        var Buffer = buffer.Buffer
        
        
        Severity: Major
        Found in web/iconv-lite.js - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              if(h<0 || m<0 || s<0 || ms<0 || h>23 || m>59 || s>59 || ms>999 || micros<0 || micros>999) { return false; }
          Severity: Critical
          Found in web/best-globals.js - About 2 hrs to fix

            Function DBCSCodec has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function DBCSCodec(codecOptions, iconv) {
                this.encodingName = codecOptions.encodingName;
                if (!codecOptions)
                    throw new Error("DBCS codec is called without the data.")
                if (!codecOptions.table)
            Severity: Minor
            Found in web/iconv-lite.js - About 2 hrs to fix

              Function arrayIndexOf has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
                var indexSize = 1
                var arrLength = arr.length
                var valLength = val.length
              
              
              Severity: Minor
              Found in web/buffer.js - About 1 hr to fix

                Function arrayIndexOf has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
                  var indexSize = 1
                  var arrLength = arr.length
                  var valLength = val.length
                
                
                Severity: Minor
                Found in web/iconv-lite.js - About 1 hr to fix

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

                    Function fill has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Buffer.prototype.fill = function fill (val, start, end, encoding) {
                      // Handle string cases:
                      if (typeof val === 'string') {
                        if (typeof start === 'string') {
                          encoding = start
                    Severity: Minor
                    Found in web/iconv-lite.js - About 1 hr to fix

                      Function fill has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Buffer.prototype.fill = function fill (val, start, end, encoding) {
                        // Handle string cases:
                        if (typeof val === 'string') {
                          if (typeof start === 'string') {
                            encoding = start
                      Severity: Minor
                      Found in web/buffer.js - About 1 hr to fix

                        Function compare has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
                          if (!Buffer.isBuffer(target)) {
                            throw new TypeError('Argument must be a Buffer')
                          }
                        
                        
                        Severity: Minor
                        Found in web/buffer.js - About 1 hr to fix

                          Function compare has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
                            if (!Buffer.isBuffer(target)) {
                              throw new TypeError('Argument must be a Buffer')
                            }
                          
                          
                          Severity: Minor
                          Found in web/iconv-lite.js - About 1 hr to fix

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

                              Function fixLines has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              txtToSql.fixLines = function fixLines(info, lines) {
                                  var errors=[];
                                  var numColumns = info.columnsInfo.length;
                                  var ln=0;
                                  var linesJoined=0;
                              Severity: Minor
                              Found in web/txt-to-sql.js - About 1 hr to fix

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

                                  Function toHtmlDoc has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  HtmlBase.prototype.toHtmlDoc=function toHtmlDoc(opts,recurseOpts){
                                      opts = opts||{};
                                      var html = jsToHtml.html;
                                      var target=this;
                                      if(!opts.incomplete){
                                  Severity: Minor
                                  Found in web/js-to-html.js - About 1 hr to fix

                                    Function fixLines has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    txtToSql.fixLines = function fixLines(info, lines) {
                                        var errors=[];
                                        var numColumns = info.columnsInfo.length;
                                        var ln=0;
                                        var linesJoined=0;
                                    Severity: Minor
                                    Found in lib/txt-to-sql.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language