codenautas/txt-to-sql

View on GitHub

Showing 405 of 405 total issues

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

    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 changing has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        bestGlobals.changing = function changing(original, changes){
            var opts = bestGlobals.changing.retreiveOptions(arguments);
            if(original===null ||
                !bestGlobals.isPlainObject(original) &&
                    !(original instanceof Error) &&
        Severity: Minor
        Found in web/best-globals.js - About 1 hr to fix

          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 lib/txt-to-sql.js - About 1 hr to fix

            Function registerJson4All has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            bestGlobals.registerJson4All = function registerJson4All(JSON4all){
                JSON4all.addType(Date, {
                    specialTag: function specialTag(value){
                        if(value.isRealDate){
                            return 'date';
            Severity: Minor
            Found in web/best-globals.js - About 1 hr to fix

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              function separateWithSeparator(info) {
                  return info.headers.split(info.opts.separator).map(function(name){ return {
                      name:name,
                      columnLength:0,
                  };});
              Severity: Major
              Found in lib/txt-to-sql.js and 1 other location - About 1 hr to fix
              web/txt-to-sql.js on lines 399..404

              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 60.

              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

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              function separateWithSeparator(info) {
                  return info.headers.split(info.opts.separator).map(function(name){ return {
                      name:name,
                      columnLength:0,
                  };});
              Severity: Major
              Found in web/txt-to-sql.js and 1 other location - About 1 hr to fix
              lib/txt-to-sql.js on lines 399..404

              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 60.

              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

              Further Reading

              Function define has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      window.define = function define(){
                          var argPos=0;
                          var name;
                          var dependencies=['require'];
                          var factory;
              Severity: Minor
              Found in web/require-bro.js - About 1 hr to fix

                Function toHms has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    this.toHms = function toHms(omitSeconds, withDays, omitLeftCeros) {
                        var leftCero = omitLeftCeros?'':'0';
                        var tm = this.timeInterval.ms;
                        var prefix = (tm<0?'-':'');
                        var tdiff = [];
                Severity: Minor
                Found in web/best-globals.js - About 1 hr to fix

                  Function requireBro has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      window.require = function requireBro(name){
                          if(window.require.definedModules[name]){
                              return window.require.definedModules[name];
                          }else{
                              var moduleName=name.replace(/^(\.\/)?(.*\/)*([^./]+)(\.js)?$/, function(match, fromThisPath, path, moduleName, extJs){
                  Severity: Minor
                  Found in web/require-bro.js - About 1 hr to fix

                    Function getCodec has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    iconv.getCodec = function getCodec(encoding) {
                        if (!iconv.encodings)
                            iconv.encodings = require("../encodings"); // Lazy load all encoding definitions.
                        
                        // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
                    Severity: Minor
                    Found in web/iconv-lite.js - About 1 hr to fix

                      Function browserifyOutDated has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function browserifyOutDated(moduleName, relativeModuleFileName, exposedName, outputDir) {
                          var moduleDir = './node_modules/'+moduleName+'/';
                          var registry='./tools/versions.json';
                          var regJSON, modJSON;
                          var mustUpdate = false;
                      Severity: Minor
                      Found in tools/web.js - About 1 hr to fix

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                        function separateLines(info){
                            info.lines = info.decodedBuffer.split(/\r?\n/);
                            info.headers = info.lines.shift();
                            return info;
                        }
                        Severity: Major
                        Found in web/txt-to-sql.js and 1 other location - About 1 hr to fix
                        lib/txt-to-sql.js on lines 334..338

                        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 57.

                        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

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                        function separateLines(info){
                            info.lines = info.decodedBuffer.split(/\r?\n/);
                            info.headers = info.lines.shift();
                            return info;
                        }
                        Severity: Major
                        Found in lib/txt-to-sql.js and 1 other location - About 1 hr to fix
                        web/txt-to-sql.js on lines 334..338

                        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 57.

                        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

                        Further Reading

                        Function 21 has a Cognitive Complexity of 10 (exceeds 5 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

                        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 fromByteArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function fromByteArray (uint8) {
                          var tmp
                          var len = uint8.length
                          var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
                          var parts = []
                        Severity: Minor
                        Found in web/iconv-lite.js - About 1 hr to fix

                          Function createInsertValues has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function createInsertValues(info, rows) {
                              var inserts = [];
                              var group = [];
                              rows.forEach(function(row, index){
                                  var owedLength = 0;
                          Severity: Minor
                          Found in web/txt-to-sql.js - About 1 hr to fix

                            Function fromByteArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function fromByteArray (uint8) {
                              var tmp
                              var len = uint8.length
                              var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
                              var parts = []
                            Severity: Minor
                            Found in web/buffer.js - About 1 hr to fix

                              Function createInsertValues has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function createInsertValues(info, rows) {
                                  var inserts = [];
                                  var group = [];
                                  rows.forEach(function(row, index){
                                      var owedLength = 0;
                              Severity: Minor
                              Found in lib/txt-to-sql.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language