codenautas/txt-to-sql

View on GitHub

Showing 405 of 405 total issues

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

function filling(columnLength, val) { return val.length>=columnLength?'':new Array(columnLength - val.length + 1).join(' '); }
Severity: Minor
Found in lib/txt-to-sql.js and 1 other location - About 50 mins to fix
web/txt-to-sql.js on lines 33..33

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

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 checkIEEE754 has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function checkIEEE754 (buf, value, offset, ext, max, min) {
Severity: Minor
Found in web/buffer.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

            } else if (i + 1 === length) {
              // unpaired lead
              if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
              continue
            }
    Severity: Major
    Found in web/buffer.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if(separated.length>1) {
                              brokenLine.cols += separated.length-1;
                          }
      Severity: Major
      Found in web/txt-to-sql.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
                      codePoint = tempCodePoint
                    }
        Severity: Major
        Found in web/buffer.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if(brokenLine.lines.length===1) {
                                  errors.push(txtToSql.errString(info, 'errBadRow',[ln, firstLine.length, numColumns]));
                              } else {
                                  errors.push(txtToSql.errString(info, 'errBadRowMulti', [parseInt(brokenLine.num+linesJoined+1,10),
                                                                                          parseInt(ln+linesJoined,10),
          Severity: Major
          Found in web/txt-to-sql.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if(lines[ln].substr(0, info.opts.separator.length) !== info.opts.separator) {
                                    brokenLine.lines.push('\n');
                                }
            Severity: Major
            Found in web/txt-to-sql.js - About 45 mins to fix

              Function write has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
              Severity: Minor
              Found in web/buffer.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
                Severity: Major
                Found in web/buffer.js - About 45 mins to fix

                  Function write has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
                  Severity: Minor
                  Found in web/iconv-lite.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if (tempCodePoint > 0x7F) {
                                  codePoint = tempCodePoint
                                }
                    Severity: Major
                    Found in web/buffer.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
                                    codePoint = tempCodePoint
                                  }
                      Severity: Major
                      Found in web/buffer.js - About 45 mins to fix

                        Function ymdHms has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        bestGlobals.datetime.ymdHms = function ymdHms(y, m, d, hh, mm, ss) {
                        Severity: Minor
                        Found in web/best-globals.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                if ((units -= 3) < 0) break
                          Severity: Major
                          Found in web/buffer.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if(window[camelName]){
                                                        /* jshint -W093 */ 
                                                        return window.require.definedModules[name] = window[camelName];
                                                        /* jshint +W093 */ 
                                                    }else{
                            Severity: Major
                            Found in web/require-bro.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                  } else if (codePoint < 0x110000) {
                                    if ((units -= 4) < 0) break
                                    bytes.push(
                                      codePoint >> 0x12 | 0xF0,
                                      codePoint >> 0xC & 0x3F | 0x80,
                              Severity: Major
                              Found in web/buffer.js - About 45 mins to fix

                                Function checkInt has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                function checkInt (buf, value, offset, ext, max, min) {
                                Severity: Minor
                                Found in web/iconv-lite.js - About 45 mins to fix

                                  Function checkIEEE754 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  function checkIEEE754 (buf, value, offset, ext, max, min) {
                                  Severity: Minor
                                  Found in web/iconv-lite.js - About 45 mins to fix

                                    Function checkInt has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    function checkInt (buf, value, offset, ext, max, min) {
                                    Severity: Minor
                                    Found in web/buffer.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if (0xDC00 <= codeTrail && codeTrail < 0xE000)
                                                              writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);
                                                          else
                                                              throw new Error("Incorrect surrogate pair in "  + this.encodingName + " at chunk " + chunk[0]);
                                      Severity: Major
                                      Found in web/iconv-lite.js - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language