lebretr/sequelize-oracle

View on GitHub

Showing 575 of 575 total issues

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

      if (options.include) {
        var generateJoinQueries = function(include, parentTable) {
          var table         = include.daoFactory.tableName
            , as            = include.as
            , joinQueryItem = ""
Severity: Major
Found in lib/dialects/oracle/query-generator.js and 1 other location - About 1 wk to fix
lib/dialects/abstract/query-generator.js on lines 623..786

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

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.include) {
        var generateJoinQueries = function(include, parentTable) {
          var table         = include.daoFactory.tableName
            , as            = include.as
            , joinQueryItem = ""
Severity: Major
Found in lib/dialects/abstract/query-generator.js and 1 other location - About 1 wk to fix
lib/dialects/oracle/query-generator.js on lines 493..656

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

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 a Cognitive Complexity of 349 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = (function() {
  var QueryGenerator = {
    dialect: 'oracle',
    
    addSchema: function(opts) {
Severity: Minor
Found in lib/dialects/oracle/query-generator.js - About 1 wk 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 341 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = (function() {
  var QueryGenerator = {
    addSchema: function(opts) {
      throwMethodUndefined('addSchema')
    },
Severity: Minor
Found in lib/dialects/abstract/query-generator.js - About 1 wk 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 1225 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = (function() {
  var DAOFactory = function(name, attributes, options) {
    this.options = Utils._.extend({
      timestamps: true,
      createdAt: 'createdAt',
Severity: Major
Found in lib/dao-factory.js - About 6 days to fix

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

    module.exports = (function() {
      var DAOFactory = function(name, attributes, options) {
        this.options = Utils._.extend({
          timestamps: true,
          createdAt: 'createdAt',
    Severity: Minor
    Found in lib/dao-factory.js - About 5 days 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 262 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = (function() {
      var QueryGenerator = {
        options: {},
        dialect: 'postgres',
    
    
    Severity: Minor
    Found in lib/dialects/postgres/query-generator.js - About 5 days 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

        if (this.useReplicaton) {
          var reads = 0
            , writes = 0
    
          // Init configs with options from config if not present
    Severity: Major
    Found in lib/dialects/mariadb/connector-manager.js and 1 other location - About 4 days 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 800.

    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

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

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

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

    module.exports = (function() {
      var QueryInterface = function(sequelize) {
        this.sequelize                = sequelize
        this.QueryGenerator           = require('./dialects/' + this.sequelize.options.dialect + '/query-generator')
        this.QueryGenerator.options   = this.sequelize.options
    Severity: Major
    Found in lib/query-interface.js - About 3 days to fix

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

      module.exports = (function() {
        var DAO = function(values, options) {
          this.dataValues                  = {}
          this._previousDataValues         = {}
          this.__options                   = this.__factory.options
      Severity: Minor
      Found in lib/dao.js - About 3 days 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 757 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = (function() {
        var QueryGenerator = {
          addSchema: function(opts) {
            throwMethodUndefined('addSchema')
          },
      Severity: Major
      Found in lib/dialects/abstract/query-generator.js - About 3 days to fix

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

        module.exports = (function() {
          var QueryGenerator = {
            dialect: 'mysql',
            addSchema: function(opts) {
              var tableName
        Severity: Minor
        Found in lib/dialects/mysql/query-generator.js - About 3 days 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 674 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          File dao-factory.js has 1235 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var Utils       = require("./utils")
            , DAO         = require("./dao")
            , DataTypes   = require("./data-types")
            , Util        = require('util')
            , sql         = require('sql')
          Severity: Major
          Found in lib/dao-factory.js - About 3 days to fix

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

            module.exports = (function() {
              var QueryGenerator = {
                options: {},
                dialect: 'sqlite',
            
            
            Severity: Minor
            Found in lib/dialects/sqlite/query-generator.js - About 2 days 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 555 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

              module.exports = (function() {
                var DAO = function(values, options) {
                  this.dataValues                  = {}
                  this._previousDataValues         = {}
                  this.__options                   = this.__factory.options
              Severity: Major
              Found in lib/dao.js - About 2 days to fix

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

                module.exports = (function() {
                  var QueryInterface = function(sequelize) {
                    this.sequelize                = sequelize
                    this.QueryGenerator           = require('./dialects/' + this.sequelize.options.dialect + '/query-generator')
                    this.QueryGenerator.options   = this.sequelize.options
                Severity: Minor
                Found in lib/query-interface.js - About 2 days 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

                  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

                Severity
                Category
                Status
                Source
                Language