codenautas/txt-to-sql

View on GitHub

Showing 405 of 405 total issues

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

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        "max": {
            "tags": {
                "input": {"description": "Maximum value","value": "Varies*"},
                "meter": {"description": "Upper bound of range","value": "Valid floating-point number*"},
                "progress": {"description": "Upper bound of range","value": "Valid floating-point number*"}
    Severity: Major
    Found in web/js-to-html.js and 4 other locations - About 1 hr to fix
    web/js-to-html.js on lines 520..527
    web/js-to-html.js on lines 658..665
    web/js-to-html.js on lines 1110..1117
    web/js-to-html.js on lines 1118..1125

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

    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

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        "alt": {
            "tags": {
                "area": {"description": "Replacement text for use when images are not available","value": "Text*"},
                "img": {"description": "Replacement text for use when images are not available","value": "Text*"},
                "input": {"description": "Replacement text for use when images are not available","value": "Text*"}
    Severity: Major
    Found in web/js-to-html.js and 4 other locations - About 1 hr to fix
    web/js-to-html.js on lines 658..665
    web/js-to-html.js on lines 951..958
    web/js-to-html.js on lines 1110..1117
    web/js-to-html.js on lines 1118..1125

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

    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

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        "rel": {
            "tags": {
                "a": {"description": "Relationship between the document containing the hyperlink and the destination resource","value": "Set of space-separated tokens*"},
                "area": {"description": "Relationship between the document containing the hyperlink and the destination resource","value": "Set of space-separated tokens*"},
                "link": {"description": "Relationship between the document containing the hyperlink and the destination resource","value": "Set of space-separated tokens*"}
    Severity: Major
    Found in web/js-to-html.js and 4 other locations - About 1 hr to fix
    web/js-to-html.js on lines 520..527
    web/js-to-html.js on lines 658..665
    web/js-to-html.js on lines 951..958
    web/js-to-html.js on lines 1118..1125

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

    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

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        "datetime": {
            "tags": {
                "del": {"description": "Date and (optionally) time of the change","value": "Valid date string with optional time"},
                "ins": {"description": "Date and (optionally) time of the change","value": "Valid date string with optional time"},
                "time": {"description": "Machine-readable value","value": "Valid month string, valid date string, valid yearless date string, valid time string, valid local date and time string, valid time-zone offset string, valid global date and time string, valid week string, valid non-negative integer, or valid duration string"}
    Severity: Major
    Found in web/js-to-html.js and 4 other locations - About 1 hr to fix
    web/js-to-html.js on lines 520..527
    web/js-to-html.js on lines 951..958
    web/js-to-html.js on lines 1110..1117
    web/js-to-html.js on lines 1118..1125

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

    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 checkEncodingParam(info, encoding, inOrOut, errors) {
        if(encoding && txtToSql.validEncodings.indexOf(encoding)===-1) {
            errors.push(txtToSql.errString(info, 'errBadEncoding',[inOrOut, encoding]));
        }
    }
    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 225..229

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

    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

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

        "required": {
            "tags": {
                "input": {"description": "Whether the control is required for form submission","value": "Boolean attribute"},
                "select": {"description": "Whether the control is required for form submission","value": "Boolean attribute"},
                "textarea": {"description": "Whether the control is required for form submission","value": "Boolean attribute"}
    Severity: Major
    Found in web/js-to-html.js and 4 other locations - About 1 hr to fix
    web/js-to-html.js on lines 520..527
    web/js-to-html.js on lines 658..665
    web/js-to-html.js on lines 951..958
    web/js-to-html.js on lines 1110..1117

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

    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 checkEncodingParam(info, encoding, inOrOut, errors) {
        if(encoding && txtToSql.validEncodings.indexOf(encoding)===-1) {
            errors.push(txtToSql.errString(info, 'errBadEncoding',[inOrOut, encoding]));
        }
    }
    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 225..229

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

    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 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 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/iconv-lite.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 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 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

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

                function adaptText(x){
                    if(x===''){ return 'null'; }
                    return "'"+x.replace(/'/g,"''").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"; 
                    //return "'"+x.replace(/'/g,"''")+"'";
                }
                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 27..31

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

                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 adaptText(x){
                    if(x===''){ return 'null'; }
                    return "'"+x.replace(/'/g,"''").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"; 
                    //return "'"+x.replace(/'/g,"''")+"'";
                }
                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 27..31

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

                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 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/buffer.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
                    Severity
                    Category
                    Status
                    Source
                    Language