betajs/betajs-data

View on GitHub

Showing 182 of 182 total issues

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

        evaluate_value: function(value, object_value) {
            return !this.is_query_atom(value) ? this.evaluate_conditions(value, object_value) : this.evaluate_atom(value, object_value);
        },
Severity: Minor
Found in src/data/queries/queries.js and 1 other location - About 40 mins to fix
src/data/queries/queries.js on lines 155..157

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

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

                return this.__separate_ids ? this.table().removeRow(this.id_row(id)) : this.table().removeById(id);
Severity: Minor
Found in src/data/databases/database_store.js and 1 other location - About 40 mins to fix
src/data/databases/database_store.js on lines 34..34

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

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

        validate_value: function(value, capabilities) {
            return !this.is_query_atom(value) ? this.validate_conditions(value, capabilities) : this.validate_atom(value, capabilities);
        },
Severity: Minor
Found in src/data/queries/queries.js and 1 other location - About 40 mins to fix
src/data/queries/queries.js on lines 247..249

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

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

Consider simplifying this complex logical expression.
Open

                if (this.option("auto_update") && (!this.isNew() || (!this.__disableSaveOnChange && this.__saveOnChange && (!this.__saveOnChangeWeak || !!value))))
                    this.save();
Severity: Major
Found in src/modelling/models.js - About 40 mins to fix

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

                    if (this._options.map)
                        value = this._options.map.call(this._options.mapctx || this, value);
    src/modelling/associations/belongs_to_associations.js on lines 17..18

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

    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._options.map)
                        result = this._options.map.call(this._options.mapctx || this, result);
    Severity: Minor
    Found in src/modelling/associations/belongs_to_associations.js and 1 other location - About 40 mins to fix
    src/modelling/associations/has_many_through_array_associations.js on lines 77..78

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

    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 update has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                    update: function(groupValue, newItemValue, oldItemValue, itemIndex, itemCount) {
    Severity: Minor
    Found in src/modelling/grouped.js - About 35 mins to fix

      Function cacheUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                  cacheUpdate: function (id, data, options, ctx, transaction_id) {
      Severity: Minor
      Found in src/data/stores/partial/cached_store.js - About 35 mins to fix

        Function _undecodedUpdated has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    _undecodedUpdated: function (id, updatedData, ctx, row, transaction_id) {
        Severity: Minor
        Found in src/data/stores/delegators/contextualized_store.js - About 35 mins to fix

          Function constructor has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                      constructor: function(model, foreign_table, foreign_key, foreign_type_key, options) {
          Severity: Minor
          Found in src/modelling/associations/polymorphic_has_many_key_associations.js - About 35 mins to fix

            Function _toContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                         _toContext: function (member, uriData, post, get, ctx) {
            Severity: Minor
            Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

              Function _updated has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      _updated: function (row, data, ctx, pre_data, transaction_id) {
              Severity: Minor
              Found in src/data/stores/base/write_store.js - About 35 mins to fix

                Function restInvoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                             restInvoke: function (method, uri, post, get, ctx) {
                Severity: Minor
                Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                  Function routeredRestInvoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                              routeredRestInvoke: function (member, uriData, post, get, ctx) {
                  Severity: Minor
                  Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                    Function _updated has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                                _updated: function (row, data, ctx, pre_data, transaction_id) {
                    Severity: Minor
                    Found in src/data/stores/delegators/contextualized_store.js - About 35 mins to fix

                      Function constructor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                                  constructor: function(model, foreign_key, foreign_type_key, table_lookup_function, options) {
                      Severity: Minor
                      Found in src/modelling/associations/polymorphic_belongs_to_associations.js - About 35 mins to fix

                        Function toContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                            toContext: function (member, uriData, post, get, ctx) {
                        Severity: Minor
                        Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                          Function sourceUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                      sourceUpdate: function (row, data, dummy_ctx, pre_data, transaction_id) {
                          Severity: Minor
                          Found in src/data/stores/base/store_history.js - About 35 mins to fix

                            Function constructor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                        constructor: function(database, table_name, id_key, separate_ids, table_options) {
                            Severity: Minor
                            Found in src/data/databases/database_store.js - About 35 mins to fix

                              Function insert has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                                      "insert": function (member, uriData, post, get, ctx) {
                              Severity: Minor
                              Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language