lebretr/sequelize-oracle

View on GitHub
lib/dialects/mysql/connector-manager.js

Summary

Maintainability
F
1 wk
Test Coverage

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

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

    module.exports = (function() {
      var ConnectorManager = function(sequelize, config) {
        try {
          if (config.dialectModulePath) {
            mysql = require(config.dialectModulePath)
    Severity: Minor
    Found in lib/dialects/mysql/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 ConnectorManager has 140 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var ConnectorManager = function(sequelize, config) {
        try {
          if (config.dialectModulePath) {
            mysql = require(config.dialectModulePath)
          } else {
    Severity: Major
    Found in lib/dialects/mysql/connector-manager.js - About 5 hrs to fix

      File connector-manager.js has 373 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var mysql
        , Pooling = require('generic-pool')
        , Query   = require("./query")
        , Utils   = require("../../utils")
        , without = function(arr, elem) { return arr.filter(function(e) { return e != elem }) }
      Severity: Minor
      Found in lib/dialects/mysql/connector-manager.js - About 4 hrs to fix

        Function connect has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var connect = function(done, config) {
            config = config || this.config
        
            var emitter = new (require('events').EventEmitter)()
            var connectionConfig = {
        Severity: Minor
        Found in lib/dialects/mysql/connector-manager.js - About 1 hr to fix

          Function query has 34 lines of code (exceeds 25 allowed). 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: Minor
          Found in lib/dialects/mysql/connector-manager.js - About 1 hr to fix

            Function getConnection has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              ConnectorManager.prototype.getConnection = function(options, callback) {
                var self = this;
            
                if (typeof options === "function") {
                  callback = options;
            Severity: Minor
            Found in lib/dialects/mysql/connector-manager.js - About 1 hr to fix

              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/mysql/connector-manager.js and 1 other location - About 2 days to fix
              lib/dialects/oracle/connector-manager.js on lines 165..206

              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

                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

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

                  if (this.useReplicaton) {
                    var reads = 0
                      , writes = 0;
              
                    // Init configs with options from config if not present
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 1 other location - About 5 hrs to fix
              lib/dialects/oracle/connector-manager.js on lines 43..147

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

              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

                var enqueue = function(queueItem, options) {
                  options = options || {}
                  if (this.activeQueue.length < this.maxConcurrentQueries) {
                    this.activeQueue.push(queueItem)
                    execQueueItem.call(this, queueItem)
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 1 other location - About 3 hrs to fix
              lib/dialects/oracle/connector-manager.js on lines 388..396

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

              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

                ConnectorManager.prototype.__defineGetter__('hasQueuedItems', function() {
                  return (this.queue.length > 0) || (this.activeQueue.length > 0) || (this.client && this.client._queue && (this.client._queue.length > 0))
                })
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 2 hrs to fix
              lib/dialects/mariadb/connector-manager.js on lines 379..381
              lib/dialects/oracle/connector-manager.js on lines 444..446

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

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

                var disconnectIfNoConnections = function() {
                  var self = this
              
                  this.disconnectTimeoutId && clearTimeout(this.disconnectTimeoutId)
                  this.disconnectTimeoutId = setTimeout(function() {
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 2 hrs to fix
              lib/dialects/mariadb/connector-manager.js on lines 392..399
              lib/dialects/oracle/connector-manager.js on lines 457..464

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

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

                  this.onProcessExit = function () {
                    //be nice & close our connections on exit
                    if (self.pool) {
                      self.pool.drain()
                    } else if (self.client) {
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 2 hrs to fix
              lib/dialects/mariadb/connector-manager.js on lines 145..154
              lib/dialects/oracle/connector-manager.js on lines 149..158

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

              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 (err) {
                      switch(err.code) {
                      case 'ECONNREFUSED':
                      case 'ER_ACCESS_D2ENIED_ERROR':
                        emitter.emit('error', 'Failed to authenticate for MySQL. Please double check your settings.')
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 1 other location - About 1 hr to fix
              lib/dialects/oracle/connector-manager.js on lines 345..362

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

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

                var transferQueuedItems = function(count) {
                  for(var i = 0; i < count; i++) {
                    var queueItem = this.queue.shift();
                    if (queueItem) {
                      enqueue.call(this, queueItem)
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 1 hr to fix
              lib/dialects/mariadb/connector-manager.js on lines 353..360
              lib/dialects/oracle/connector-manager.js on lines 406..413

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

              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

                  try {
                    if (config.dialectModulePath) {
                      mysql = require(config.dialectModulePath)
                    } else {
                      mysql = require('mysql')
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 1 hr to fix
              lib/dialects/mariadb/connector-manager.js on lines 9..17
              lib/dialects/oracle/connector-manager.js on lines 9..17

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

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

                var afterQuery = function(queueItem) {
                  dequeue.call(this, queueItem)
                  transferQueuedItems.call(this, this.maxConcurrentQueries - this.activeQueue.length)
                  disconnectIfNoConnections.call(this)
                }
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 1 hr to fix
              lib/dialects/mariadb/connector-manager.js on lines 362..366
              lib/dialects/oracle/connector-manager.js on lines 415..419

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

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

                var handleDisconnect = function(pool, client) {
                  client.on('error', function(err) {
                    if (err.code !== 'PROTOCOL_CONNECTION_LOST') {
                      throw err
                    }
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 1 hr to fix
              lib/dialects/mariadb/connector-manager.js on lines 310..317
              lib/dialects/oracle/connector-manager.js on lines 375..382

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

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

                  if (config.dialectOptions) {
                    Object.keys(config.dialectOptions).forEach(function (key) {
                      connectionConfig[key] = config.dialectOptions[key];
                    });
                  }
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 1 hr to fix
              lib/dialects/mariadb/connector-manager.js on lines 274..278
              lib/dialects/oracle/connector-manager.js on lines 330..334

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

              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

                  this.poolCfg = Utils._.defaults(this.config.pool, {
                    maxConnections: 10,
                    minConnections: 0,
                    maxIdleTime: 1000,
                    handleDisconnects: false,
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 1 other location - About 1 hr to fix
              lib/dialects/oracle/connector-manager.js on lines 30..36

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

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

                    queueItem.query
                      .success(function(){ afterQuery.call(self, queueItem) })
                      .error(function(){ afterQuery.call(self, queueItem) })
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 1 hr to fix
              lib/dialects/mariadb/connector-manager.js on lines 372..374
              lib/dialects/oracle/connector-manager.js on lines 436..438

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

                ConnectorManager.prototype.disconnect = function() {
                  if (this.client) {
                    disconnect.call(this, this.client)
                  }
                  return
              Severity: Major
              Found in lib/dialects/mysql/connector-manager.js and 2 other locations - About 45 mins to fix
              lib/dialects/mariadb/connector-manager.js on lines 224..229
              lib/dialects/oracle/connector-manager.js on lines 254..259

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

              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

              There are no issues that match your filters.

              Category
              Status