betajs/betajs-data

View on GitHub

Showing 182 of 182 total issues

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

                    if (metaAttr.remove) {
                        this.on("items:remove", function(item) {
                            groupValue = metaAttr.remove(groupValue, item.get(attrKey), item);
                            silent = true;
                            this.set(attrKey, metaAttr.map ? metaAttr.map(groupValue) : groupValue);
Severity: Major
Found in src/modelling/grouped.js and 1 other location - About 3 hrs to fix
src/modelling/grouped.js on lines 53..60

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

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

            push: function () {
                if (this.pushing)
                    return Promise.value(true);
                var failedIds = {};
                var unlockIds = {};
Severity: Major
Found in src/data/stores/partial/partial_store_write_strategies.js - About 3 hrs to fix

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

    var s = function (Data) {
        var store = new Data.Stores.MemoryMapStore();
        for (var i = 0; i < 100; ++i)
            for (var j = 0; j < 100; ++j)
                store.insert({i:i,j:j});
    Severity: Major
    Found in benchmarks/compare/memory_map_store_query.js and 1 other location - About 3 hrs to fix
    benchmarks/compare/memory_store_query.js on lines 1..7

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

    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

    var s = function (Data) {
        var store = new Data.Stores.MemoryStore();
        for (var i = 0; i < 100; ++i)
            for (var j = 0; j < 100; ++j)
                store.insert({i:i,j:j});
    Severity: Major
    Found in benchmarks/compare/memory_store_query.js and 1 other location - About 3 hrs to fix
    benchmarks/compare/memory_map_store_query.js on lines 1..7

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

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

            rangeSuperQueryDiffQuery: function(superCandidate, subCandidate) {
                if (!Objs.keyEquals(superCandidate, subCandidate))
                    return false;
                var rangeKey = Objs.objectify(["$gt", "$lt", "$gte", "$lte"]);
                var ors = [];
    Severity: Major
    Found in src/data/queries/queries.js - About 2 hrs to fix

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

                  _insert: function () {
                      var args = arguments;
                      return this._primary().insert.apply(this._primary(), args).mapError(function () {
                          return this._secondary().insert.apply(this._secondary(), args);
                      }, this);
      Severity: Major
      Found in src/data/stores/delegators/concat_store.js and 2 other locations - About 2 hrs to fix
      src/data/stores/delegators/concat_store.js on lines 38..43
      src/data/stores/delegators/concat_store.js on lines 52..57

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

      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

                  _update: function () {
                      var args = arguments;
                      return this._primary().update.apply(this._primary(), args).mapError(function () {
                          return this._secondary().update.apply(this._secondary(), args);
                      }, this);
      Severity: Major
      Found in src/data/stores/delegators/concat_store.js and 2 other locations - About 2 hrs to fix
      src/data/stores/delegators/concat_store.js on lines 31..36
      src/data/stores/delegators/concat_store.js on lines 38..43

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

      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

                  _remove: function () {
                      var args = arguments;
                      return this._primary().remove.apply(this._primary(), args).mapError(function () {
                          return this._secondary().remove.apply(this._secondary(), args);
                      }, this);
      Severity: Major
      Found in src/data/stores/delegators/concat_store.js and 2 other locations - About 2 hrs to fix
      src/data/stores/delegators/concat_store.js on lines 31..36
      src/data/stores/delegators/concat_store.js on lines 52..57

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

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

                  constructor: function(source, query, options) {
                      options = options || {};
                      inherited.constructor.call(this, {
                          release_references: true,
                          uniqueness: options.uniqueness,
      Severity: Major
      Found in src/collections/abstract_query_collection.js - About 2 hrs to fix

        Function next has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            var next = function () {
                                if (!iter.hasNext()) {
                                    iter.destroy();
                                    this.pushing = false;
                                    this.storeHistory.unlockCommits();
        Severity: Major
        Found in src/data/stores/partial/partial_store_write_strategies.js - About 2 hrs to fix

          Function iterResult has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      var iterResult = Objs.iter(superCandidate, function(superValue, key) {
                          superValue = Objs.clone(superValue, 1);
                          var subValue = Objs.clone(subCandidate[key], 1);
                          Objs.iter(rangeKey, function(dummy, k) {
                              if (superValue[k] && subValue[k] && superValue[k] === subValue[k]) {
          Severity: Major
          Found in src/data/queries/queries.js - About 2 hrs to fix

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

                        _remove: function (id, ctx) {
                            return this._acquireStore(ctx).mapSuccess(function (store) {
                                return store.remove(id, this._mapContext(ctx)).callback(function () {
                                    this._releaseStore(ctx, store);
                                }, this);
            Severity: Major
            Found in src/data/stores/delegators/multiplexer_store.js and 2 other locations - About 2 hrs to fix
            src/data/stores/delegators/multiplexer_store.js on lines 34..40
            src/data/stores/delegators/multiplexer_store.js on lines 58..64

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

            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

                        _get: function (id, ctx) {
                            return this._acquireStore(ctx).mapSuccess(function (store) {
                                return store.get(id, this._mapContext(ctx)).callback(function () {
                                    this._releaseStore(ctx, store);
                                }, this);
            Severity: Major
            Found in src/data/stores/delegators/multiplexer_store.js and 2 other locations - About 2 hrs to fix
            src/data/stores/delegators/multiplexer_store.js on lines 34..40
            src/data/stores/delegators/multiplexer_store.js on lines 42..48

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

            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

                        _insert: function (data, ctx) {
                            return this._acquireStore(ctx).mapSuccess(function (store) {
                                return store.insert(data, this._mapContext(ctx)).callback(function () {
                                    this._releaseStore(ctx, store);
                                }, this);
            Severity: Major
            Found in src/data/stores/delegators/multiplexer_store.js and 2 other locations - About 2 hrs to fix
            src/data/stores/delegators/multiplexer_store.js on lines 42..48
            src/data/stores/delegators/multiplexer_store.js on lines 58..64

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

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

                        cacheQuery: function (query, queryOptions, options, ctx) {
                            var queryString = Constrained.serialize({
                                query: query,
                                options: queryOptions
                            });
            Severity: Major
            Found in src/data/stores/partial/cached_store.js - About 2 hrs to fix

              File query_engine.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              Scoped.define("module:Queries.Engine", [
                  "module:Queries",
                  "module:Queries.Constrained",
                  "base:Strings",
                  "base:Types",
              Severity: Minor
              Found in src/data/queries/query_engine.js - About 2 hrs to fix

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

                            _watchItem : function(id) {
                                inherited.watchItem.call(this, id);
                                this._store.cachedStore.cachedIdToRemoteId(id).success(function (remoteId) {
                                    this._store.remoteWatcher.watchItem(remoteId, this);
                                }, this);
                Severity: Major
                Found in src/data/stores/partial/partial_store.js and 1 other location - About 2 hrs to fix
                src/data/stores/partial/partial_store.js on lines 135..140

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

                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

                            _unwatchItem : function(id) {
                                inherited.unwatchItem.call(this, id);
                                this._store.cachedStore.cachedIdToRemoteId(id).success(function (remoteId) {
                                    this._store.remoteWatcher.unwatchItem(remoteId, this);
                                }, this);
                Severity: Major
                Found in src/data/stores/partial/partial_store.js and 1 other location - About 2 hrs to fix
                src/data/stores/partial/partial_store.js on lines 128..133

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

                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

                            _insert: function (data) {
                                var decoded = this._decode(data);
                                return this.__store.insert(decoded.data, decoded.ctx).mapSuccess(function (data) {
                                    return this._encode(data, decoded.ctx);
                                }, this);
                Severity: Major
                Found in src/data/stores/delegators/contextualized_store.js and 1 other location - About 2 hrs to fix
                src/data/stores/delegators/contextualized_store.js on lines 54..59

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

                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

                            _get: function (id) {
                                var decoded = this._decodeId(id);
                                return this.__store.get(decoded.id, decoded.ctx).mapSuccess(function (data) {
                                    return this._encode(data, decoded.ctx);
                                }, this);
                Severity: Major
                Found in src/data/stores/delegators/contextualized_store.js and 1 other location - About 2 hrs to fix
                src/data/stores/delegators/contextualized_store.js on lines 40..45

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

                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