codenautas/txt-to-sql

View on GitHub

Showing 405 of 405 total issues

Function determinePrimaryKey has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function determinePrimaryKey(info) {
    if(info.opts.includePrimaryKey !== false) {
        var warnings = [];
        var columnsInKey = [];
        var haveCustomKeys = info.columnsInfo.filter(function(col,colIndex) {
Severity: Major
Found in web/txt-to-sql.js - About 2 hrs to fix

    Function determinePrimaryKey has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function determinePrimaryKey(info) {
        if(info.opts.includePrimaryKey !== false) {
            var warnings = [];
            var columnsInKey = [];
            var haveCustomKeys = info.columnsInfo.filter(function(col,colIndex) {
    Severity: Major
    Found in lib/txt-to-sql.js - About 2 hrs to fix

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

      txtToSql.defaultOpts = {
          columnNamesFormat: 'lowercased_names',
          separator: false,
          detectBooleans: false,
          includePrimaryKey: null,
      Severity: Major
      Found in lib/txt-to-sql.js and 1 other location - About 2 hrs to fix
      web/txt-to-sql.js on lines 999..1014

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

      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

      txtToSql.defaultOpts = {
          columnNamesFormat: 'lowercased_names',
          separator: false,
          detectBooleans: false,
          includePrimaryKey: null,
      Severity: Major
      Found in web/txt-to-sql.js and 1 other location - About 2 hrs to fix
      lib/txt-to-sql.js on lines 999..1014

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

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

      function utf8ToBytes (string, units) {
        units = units || Infinity
        var codePoint
        var length = string.length
        var leadSurrogate = null
      Severity: Major
      Found in web/iconv-lite.js - About 2 hrs to fix

        Function utf8ToBytes has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function utf8ToBytes (string, units) {
          units = units || Infinity
          var codePoint
          var length = string.length
          var leadSurrogate = null
        Severity: Major
        Found in web/buffer.js - About 2 hrs to fix

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

              "autocomplete": {
                  "tags": {
                      "form": {"description": "Default setting for autofill feature for controls in the form","value": "\"on\"; \"off\""},
                      "input": {"description": "Hint for form autofill feature","value": "Autofill field name and related tokens*"},
                      "select": {"description": "Hint for form autofill feature","value": "Autofill field name and related tokens*"},
          Severity: Major
          Found in web/js-to-html.js and 3 other locations - About 2 hrs to fix
          web/js-to-html.js on lines 580..588
          web/js-to-html.js on lines 820..828
          web/js-to-html.js on lines 1276..1284

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

          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 selectType(engineTypes, columnIndex, info) {
              var mapTypeIndex;
              engineTypes.some(function(col, colIndex) {
                  if(col.typeName === info.opts.columns[columnIndex].type) {
                      mapTypeIndex = colIndex;
          Severity: Major
          Found in lib/txt-to-sql.js and 1 other location - About 2 hrs to fix
          web/txt-to-sql.js on lines 514..524

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

          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 4 locations. Consider refactoring.
          Open

              "cite": {
                  "tags": {
                      "blockquote": {"description": "Link to the source of the quotation or more information about the edit","value": "Valid URL potentially surrounded by spaces"},
                      "del": {"description": "Link to the source of the quotation or more information about the edit","value": "Valid URL potentially surrounded by spaces"},
                      "ins": {"description": "Link to the source of the quotation or more information about the edit","value": "Valid URL potentially surrounded by spaces"},
          Severity: Major
          Found in web/js-to-html.js and 3 other locations - About 2 hrs to fix
          web/js-to-html.js on lines 534..542
          web/js-to-html.js on lines 820..828
          web/js-to-html.js on lines 1276..1284

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

          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 evaluateColumn(column, rows, regex) {
              for(var row=0; row<rows.length; ++row) {
                  if(rows[row][column] && ! rows[row][column].match(regex)) {
                      return false;
                  }
          Severity: Major
          Found in web/txt-to-sql.js and 1 other location - About 2 hrs to fix
          lib/txt-to-sql.js on lines 74..81

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

          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 selectType(engineTypes, columnIndex, info) {
              var mapTypeIndex;
              engineTypes.some(function(col, colIndex) {
                  if(col.typeName === info.opts.columns[columnIndex].type) {
                      mapTypeIndex = colIndex;
          Severity: Major
          Found in web/txt-to-sql.js and 1 other location - About 2 hrs to fix
          lib/txt-to-sql.js on lines 514..524

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

          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 evaluateColumn(column, rows, regex) {
              for(var row=0; row<rows.length; ++row) {
                  if(rows[row][column] && ! rows[row][column].match(regex)) {
                      return false;
                  }
          Severity: Major
          Found in lib/txt-to-sql.js and 1 other location - About 2 hrs to fix
          web/txt-to-sql.js on lines 74..81

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

          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 4 locations. Consider refactoring.
          Open

              "target": {
                  "tags": {
                      "a": {"description": "Browsing context for hyperlink navigation","value": "Valid browsing context name or keyword"},
                      "area": {"description": "Browsing context for hyperlink navigation","value": "Valid browsing context name or keyword"},
                      "base": {"description": "Default browsing context for hyperlink navigation and form submission","value": "Valid browsing context name or keyword"},
          Severity: Major
          Found in web/js-to-html.js and 3 other locations - About 2 hrs to fix
          web/js-to-html.js on lines 534..542
          web/js-to-html.js on lines 580..588
          web/js-to-html.js on lines 820..828

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

          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 4 locations. Consider refactoring.
          Open

              "href": {
                  "tags": {
                      "a": {"description": "Address of the hyperlink","value": "Valid URL potentially surrounded by spaces"},
                      "area": {"description": "Address of the hyperlink","value": "Valid URL potentially surrounded by spaces"},
                      "link": {"description": "Address of the hyperlink","value": "Valid non-empty URL potentially surrounded by spaces"},
          Severity: Major
          Found in web/js-to-html.js and 3 other locations - About 2 hrs to fix
          web/js-to-html.js on lines 534..542
          web/js-to-html.js on lines 580..588
          web/js-to-html.js on lines 1276..1284

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

          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 8 has a Cognitive Complexity of 17 (exceeds 5 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 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 17 has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{}],17:[function(require,module,exports){
          module.exports=[
          ["a140","",62],
          ["a180","",32],
          ["a240","",62],
          Severity: Major
          Found in web/iconv-lite.js - About 2 hrs to fix

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

            function transformNames(info) {
                info.quotedTableName = info.transform(info.tableName);
                info.columnsInfo.forEach(function(column){ column.name=info.transform(column.name); });
                return info;
            }
            Severity: Major
            Found in web/txt-to-sql.js and 1 other location - About 2 hrs to fix
            lib/txt-to-sql.js on lines 481..485

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

            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 transformNames(info) {
                info.quotedTableName = info.transform(info.tableName);
                info.columnsInfo.forEach(function(column){ column.name=info.transform(column.name); });
                return info;
            }
            Severity: Major
            Found in lib/txt-to-sql.js and 1 other location - About 2 hrs to fix
            web/txt-to-sql.js on lines 481..485

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

            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 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 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/iconv-lite.js - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language