lebretr/sequelize-oracle

View on GitHub

Showing 575 of 575 total issues

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

  ConnectorManager.prototype.query = function(sql, callee, options) {
    if (this.useQueue) {
      // If queueing we'll let the execQueueItem method handle connecting
      var queueItem = {
        query: new Query(null, this.sequelize, callee, options || {}),
Severity: Major
Found in lib/dialects/oracle/connector-manager.js and 1 other location - About 2 days to fix
lib/dialects/mysql/connector-manager.js on lines 169..210

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

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

      mainAttributes = mainAttributes && mainAttributes.map(function(attr){
        var addTable = true

        if (attr instanceof Utils.literal) {
          return attr.toString(this)
Severity: Major
Found in lib/dialects/abstract/query-generator.js and 1 other location - About 1 day to fix
lib/dialects/oracle/query-generator.js on lines 454..480

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

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

      mainAttributes = mainAttributes && mainAttributes.map(function(attr){
        var addTable = true

        if (attr instanceof Utils.literal) {
          return attr.toString(this)
Severity: Major
Found in lib/dialects/oracle/query-generator.js and 1 other location - About 1 day to fix
lib/dialects/abstract/query-generator.js on lines 584..610

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

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

File query-interface.js has 804 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var Utils                = require(__dirname + '/utils')
  , DataTypes            = require(__dirname + '/data-types')
  , SQLiteQueryInterface = require(__dirname + '/dialects/sqlite/query-interface')
  , Transaction          = require(__dirname + '/transaction')
  , QueryTypes           = require('./query-types')
Severity: Major
Found in lib/query-interface.js - About 1 day to fix

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

          if (options.order) {
            var mainQueryOrder = [];
            var subQueryOrder = [];
    
            if (Array.isArray(options.order)) {
    Severity: Major
    Found in lib/dialects/oracle/query-generator.js and 1 other location - About 1 day to fix
    lib/dialects/abstract/query-generator.js on lines 830..860

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

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

          if (options.order) {
            var mainQueryOrder = [];
            var subQueryOrder = [];
    
            if (Array.isArray(options.order)) {
    Severity: Major
    Found in lib/dialects/abstract/query-generator.js and 1 other location - About 1 day to fix
    lib/dialects/oracle/query-generator.js on lines 700..730

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

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

    module.exports = (function() {
      var ConnectorManager = function(sequelize, config) {
        try {
          if (config.dialectModulePath) {
            oracle = require(config.dialectModulePath)
    Severity: Major
    Found in lib/dialects/oracle/connector-manager.js - About 1 day to fix

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

        ConnectorManager.prototype.getConnection = function(options, callback) {
          var self = this;
      
          if (typeof options === "function") {
            callback = options;
      Severity: Major
      Found in lib/dialects/mysql/connector-manager.js and 1 other location - About 1 day to fix
      lib/dialects/oracle/connector-manager.js on lines 208..252

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

      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

        ConnectorManager.prototype.getConnection = function(options, callback) {
          var self = this;
      
          if (typeof options === "function") {
            callback = options;
      Severity: Major
      Found in lib/dialects/oracle/connector-manager.js and 1 other location - About 1 day to fix
      lib/dialects/mysql/connector-manager.js on lines 212..256

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

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

      module.exports = (function() {
        var ConnectorManager = function(sequelize, config) {
          try {
            if (config.dialectModulePath) {
              mysql = require(config.dialectModulePath)
      Severity: Major
      Found in lib/dialects/mysql/connector-manager.js - About 1 day to fix

        File query-generator.js has 762 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var Utils = require("../../utils")
          , SqlString = require("../../sql-string")
          , daoFactory = require("../../dao-factory")
        
        module.exports = (function() {
        Severity: Major
        Found in lib/dialects/abstract/query-generator.js - About 1 day to fix

          Function exports has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = (function() {
            var ConnectorManager = function(sequelize, config) {
              try {
                if (config.dialectModulePath) {
                  oracle = require(config.dialectModulePath)
          Severity: Minor
          Found in lib/dialects/oracle/connector-manager.js - About 1 day 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

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

              bulkInsertQuery: function(tableName, attrValueHashes, options) {
                var query = "INSERT<%= ignoreDuplicates %> INTO <%= table %> (<%= attributes %>) VALUES <%= tuples %>;"
                  , tuples = []
                  , allAttributes = []
          
          
          Severity: Major
          Found in lib/dialects/sqlite/query-generator.js and 2 other locations - About 1 day to fix
          lib/dialects/mysql/query-generator.js on lines 181..210
          lib/dialects/oracle/query-generator.js on lines 160..189

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

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

              bulkInsertQuery: function(tableName, attrValueHashes, options) {
                var query = "INSERT<%= ignoreDuplicates %> INTO <%= table %> (<%= attributes %>) VALUES <%= tuples %>;"
                  , tuples = []
                  , allAttributes = []
          
          
          Severity: Major
          Found in lib/dialects/oracle/query-generator.js and 2 other locations - About 1 day to fix
          lib/dialects/mysql/query-generator.js on lines 181..210
          lib/dialects/sqlite/query-generator.js on lines 175..204

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

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

              bulkInsertQuery: function(tableName, attrValueHashes, options) {
                var query = "INSERT<%= ignoreDuplicates %> INTO <%= table %> (<%= attributes %>) VALUES <%= tuples %>;"
                  , tuples = []
                  , allAttributes = []
          
          
          Severity: Major
          Found in lib/dialects/mysql/query-generator.js and 2 other locations - About 1 day to fix
          lib/dialects/oracle/query-generator.js on lines 160..189
          lib/dialects/sqlite/query-generator.js on lines 175..204

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

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

          module.exports = (function() {
            var QueryGenerator = {
              dialect: 'mysql',
              addSchema: function(opts) {
                var tableName
          Severity: Major
          Found in lib/dialects/mysql/query-generator.js - About 1 day to fix

            Function exports has 335 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = (function() {
              var ConnectorManager = function(sequelize, config) {
                try {
                  if (config.dialectModulePath) {
                    mariadb = require(config.dialectModulePath)
            Severity: Major
            Found in lib/dialects/mariadb/connector-manager.js - About 1 day to fix

              Function exports has 335 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = (function() {
                var QueryGenerator = {
                  options: {},
                  dialect: 'sqlite',
              
              
              Severity: Major
              Found in lib/dialects/sqlite/query-generator.js - About 1 day to fix

                Function exports has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = (function() {
                  var ConnectorManager = function(sequelize, config) {
                    try {
                      if (config.dialectModulePath) {
                        mariadb = require(config.dialectModulePath)
                Severity: Minor
                Found in lib/dialects/mariadb/connector-manager.js - About 1 day 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 exports has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = (function() {
                  var HasManyDoubleLinked = function(association, instance) {
                    this.association = association
                    this.instance = instance
                
                
                Severity: Minor
                Found in lib/associations/has-many-double-linked.js - About 1 day 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

                Severity
                Category
                Status
                Source
                Language