betajs/betajs-data

View on GitHub

Showing 182 of 182 total issues

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

module.exports = {
    name : 'Memory Store Query',
    tests : {
        'Old Memory Store Query' : function () {
            f(storeOld);
Severity: Major
Found in benchmarks/compare/memory_store_query.js and 3 other locations - About 1 hr to fix
benchmarks/compare/memory_map_store_query.js on lines 16..26
benchmarks/compare/memory_map_store_query_with_index.js on lines 17..27
benchmarks/compare/memory_store_query_with_index.js on lines 17..27

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

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

module.exports = {
    name : 'Memory Map Store Query With Index',
    tests : {
        'Old Memory Map Store Query With Index' : function () {
            f(storeOld);
Severity: Major
Found in benchmarks/compare/memory_map_store_query_with_index.js and 3 other locations - About 1 hr to fix
benchmarks/compare/memory_map_store_query.js on lines 16..26
benchmarks/compare/memory_store_query.js on lines 16..26
benchmarks/compare/memory_store_query_with_index.js on lines 17..27

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

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

module.exports = {
    name : 'Memory Map Store Query',
    tests : {
        'Old Memory Map Store Query' : function () {
            f(storeOld);
Severity: Major
Found in benchmarks/compare/memory_map_store_query.js and 3 other locations - About 1 hr to fix
benchmarks/compare/memory_map_store_query_with_index.js on lines 17..27
benchmarks/compare/memory_store_query.js on lines 16..26
benchmarks/compare/memory_store_query_with_index.js on lines 17..27

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

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

        validate_query: function(query, capabilities) {
            return Types.is_object(query) && Objs.all(query, function(value, key) {
                return this.validate_pair(value, key, capabilities);
            }, this);
        },
Severity: Major
Found in src/data/queries/queries.js and 1 other location - About 1 hr to fix
src/data/queries/queries.js on lines 159..163

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

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

module.exports = {
    name : 'Memory Store Query With Index',
    tests : {
        'Old Memory Store Query With Index' : function () {
            f(storeOld);
Severity: Major
Found in benchmarks/compare/memory_store_query_with_index.js and 3 other locations - About 1 hr to fix
benchmarks/compare/memory_map_store_query.js on lines 16..26
benchmarks/compare/memory_map_store_query_with_index.js on lines 17..27
benchmarks/compare/memory_store_query.js on lines 16..26

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

Function migrate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            migrate: function(version) {
                var current = this._indexByVersion(this.version());
                var target = Types.is_defined(version) ? this._indexByVersion(version) : this.__migrations.length - 1;
                while (current < target) {
                    var migration = this.__migrations[current + 1];
Severity: Minor
Found in src/data/databases/migrator.js - About 1 hr to fix

    Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                constructor: function(table, query, queryopts, options) {
                    inherited.constructor.call(this);
                    this._options = options || {};
                    this._table = table;
                    this._query = query;
    Severity: Minor
    Found in src/modelling/active_model.js - About 1 hr to fix

      Function remotePromise has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                          var remotePromise = this.__remoteQueryAggregate(this.removeItemSupp(query), queryOptions, ctx).mapSuccess(function (items) {
                              this.online();
                              items = items.asArray ? items.asArray() : items;
                              var meta = {
                                  refreshMeta: options.queryRefreshMeta ? this.cacheStrategy.queryRefreshMeta() : null,
      Severity: Minor
      Found in src/data/stores/partial/cached_store.js - About 1 hr to fix

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

        module.exports = function(grunt) {
        
            var pkg = grunt.file.readJSON('package.json');
            var gruntHelper = require('betajs-compile');
            var dist = 'betajs-data';
        Severity: Minor
        Found in Gruntfile.js - About 1 hr to fix

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

                      __unwatchItem: function (id, ctx) {
                          if (this._store().watcher())
                              this._store().watcher().unwatchItem(id, ctx);
                      },
          Severity: Major
          Found in src/data/stores/invokers/invoker_store.js and 3 other locations - About 1 hr to fix
          src/data/stores/invokers/invoker_store.js on lines 173..176
          src/data/stores/invokers/invoker_store.js on lines 183..186
          src/data/stores/invokers/invoker_store.js on lines 188..191

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                      __unwatchInsert: function (query, ctx) {
                          if (this._store().watcher())
                              this._store().watcher().unwatchInsert(query, ctx);
                      }
          Severity: Major
          Found in src/data/stores/invokers/invoker_store.js and 3 other locations - About 1 hr to fix
          src/data/stores/invokers/invoker_store.js on lines 173..176
          src/data/stores/invokers/invoker_store.js on lines 178..181
          src/data/stores/invokers/invoker_store.js on lines 183..186

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                      __watchInsert: function (query, ctx) {
                          if (this._store().watcher())
                              this._store().watcher().watchInsert(query, ctx);
                      },
          Severity: Major
          Found in src/data/stores/invokers/invoker_store.js and 3 other locations - About 1 hr to fix
          src/data/stores/invokers/invoker_store.js on lines 173..176
          src/data/stores/invokers/invoker_store.js on lines 178..181
          src/data/stores/invokers/invoker_store.js on lines 188..191

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                      __watchItem: function (id, ctx) {
                          if (this._store().watcher())
                              this._store().watcher().watchItem(id, ctx);
                      },
          Severity: Major
          Found in src/data/stores/invokers/invoker_store.js and 3 other locations - About 1 hr to fix
          src/data/stores/invokers/invoker_store.js on lines 178..181
          src/data/stores/invokers/invoker_store.js on lines 183..186
          src/data/stores/invokers/invoker_store.js on lines 188..191

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

          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

                      itemAccessMeta: function (accessMeta) {
                          if (this._options.itemAccessTime === null)
                              return null;
                          return this._options.now() + this._options.itemAccessTime;
                      },
          Severity: Major
          Found in src/data/stores/partial/cached_store.js and 1 other location - About 1 hr to fix
          src/data/stores/partial/cached_store.js on lines 597..601

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

          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

                      queryAccessMeta: function (accessMeta) {
                          if (this._options.queryAccessTime === null)
                              return null;
                          return this._options.now() + this._options.queryAccessTime;
                      },
          Severity: Major
          Found in src/data/stores/partial/cached_store.js and 1 other location - About 1 hr to fix
          src/data/stores/partial/cached_store.js on lines 591..595

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

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

                      _remove: function (id) {
                          return Promise.tryCatch(function () {
                              var row = this._read_item(id);
                              if (row) {
                                  this._remove_item(id);
          Severity: Minor
          Found in src/data/stores/dumb/dumb_store.js - About 1 hr to fix

            Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        constructor: function(store, key, compare, options) {
                            inherited.constructor.call(this);
                            this._options = Objs.extend({
                                exact: true,
                                ignoreCase: false
            Severity: Minor
            Found in src/data/indices/abstract_index.js - About 1 hr to fix

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

                      validate_atoms: function(atoms, capabilities) {
                          return Types.is_array(atoms) && Objs.all(atoms, function(atom) {
                              return this.validate_atom(atom, capabilities);
                          }, this);
                      },
              Severity: Major
              Found in src/data/queries/queries.js and 1 other location - About 1 hr to fix
              src/data/queries/queries.js on lines 124..128

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

              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_queries: function(queries, capabilities) {
                          return Types.is_array(queries) && Objs.all(queries, function(query) {
                              return this.validate_query(query, capabilities);
                          }, this);
                      },
              Severity: Major
              Found in src/data/queries/queries.js and 1 other location - About 1 hr to fix
              src/data/queries/queries.js on lines 114..118

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

              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._watcher()) {
                                  this._watcher().unwatchInsert(null, this);
                                  this._watcher().unwatchItem(null, this);
                              }
              Severity: Minor
              Found in src/collections/abstract_query_collection.js and 1 other location - About 50 mins to fix
              src/modelling/active_model.js on lines 44..47

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

              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