betajs/betajs-data

View on GitHub

Showing 81 of 182 total issues

File queries.js has 546 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Scoped.define("module:Queries", [
    "base:Types",
    "base:Sort",
    "base:Objs",
    "base:Class",
Severity: Major
Found in src/data/queries/queries.js - About 1 day to fix

    File cached_store.js has 510 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Very important to know:
     *  - If both itemCache + remoteStore use the same id_key, the keys actually coincide.
     *  - If they use different keys, the cache stores the remoteStore keys as a foreign key and assigns its own keys to the cached items
     *
    Severity: Major
    Found in src/data/stores/partial/cached_store.js - About 1 day to fix

      File contextualized_store.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Scoped.define("module:Stores.ContextualizedStore", [
          "module:Stores.BaseStore",
          "base:Iterators.MappedIterator"
      ], function (BaseStore, MappedIterator, scoped) {
          return BaseStore.extend({scoped: scoped}, function (inherited) {            
      Severity: Minor
      Found in src/data/stores/delegators/contextualized_store.js - About 4 hrs to fix

        File abstract_query_collection.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * @class AbstractQueryCollection
         *
         * A base class for querying collections. Subclasses specify the expected type
         * of data store and specify whether the query collection is active.
        Severity: Minor
        Found in src/collections/abstract_query_collection.js - About 4 hrs to fix

          Function compileIndexQuery has 94 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  compileIndexQuery: function(constrainedDNFQuery, key, index) {
                      var fullQuery = Objs.exists(constrainedDNFQuery.query.$or, function(query) {
                          return !(key in query);
                      });
                      var primaryKeySort = constrainedDNFQuery.options.sort && Objs.ithKey(constrainedDNFQuery.options.sort, 0) === key;
          Severity: Major
          Found in src/data/queries/query_engine.js - About 3 hrs to fix

            File partial_store_write_strategies.js has 320 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            Scoped.define("module:Stores.PartialStoreWriteStrategies.WriteStrategy", [
                                                                                      "base:Class"
                                                                                      ], function (Class, scoped) {
                return Class.extend({scoped: scoped}, function (inherited) {
                    return {
            Severity: Minor
            Found in src/data/stores/partial/partial_store_write_strategies.js - About 3 hrs to fix

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

                          constructor: function(attributes, collection) {
                              inherited.constructor.call(this, attributes);
              
                              var silent = false;
                              var items = collection || this.auto_destroy(new Collection());
              Severity: Major
              Found in src/modelling/grouped.js - About 3 hrs to fix

                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

                  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

                    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

                          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

                              Function save has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          save: function(transaction_id) {
                                              if (this.isRemoved())
                                                  return Promise.create({});
                                              var promise = this.option("save_invalid") ? Promise.value(true) : this.validate();
                                              return promise.mapSuccess(function(valid) {
                              Severity: Major
                              Found in src/modelling/models.js - About 2 hrs to fix

                                Function cacheGet has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            cacheGet: function (id, options, ctx) {
                                                var foreignKey = options.foreignKey && this._foreignKey;
                                                return this.cacheOnlyGet(id, options, ctx).mapSuccess(function (data) {
                                                    if (!data) {
                                                        if (!foreignKey && this._foreignKey)
                                Severity: Major
                                Found in src/data/stores/partial/cached_store.js - About 2 hrs to fix

                                  Function __update has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              __update: function(constrainedQuery) {
                                                  var hasQuery = !!constrainedQuery.query;
                                                  constrainedQuery = Constrained.rectify(constrainedQuery);
                                                  var currentSkip = this._query.options.skip || 0;
                                                  var currentLimit = this._query.options.limit || null;
                                  Severity: Minor
                                  Found in src/collections/abstract_query_collection.js - About 1 hr to fix

                                    Function sourceUpdate has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                sourceUpdate: function (row, data, dummy_ctx, pre_data, transaction_id) {
                                                    return this.criticalSection("commit", function () {
                                                        this.commitId++;
                                                        var row_id = Types.is_object(row) ? row[this._options.source_id_key] : row;
                                                        var target_type = "update";
                                    Severity: Minor
                                    Found in src/data/stores/base/store_history.js - About 1 hr to fix

                                      Function disjunctiveNormalForm has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              disjunctiveNormalForm: function(query, mergeKeys) {
                                                  query = Objs.clone(query, 1);
                                                  var factors = [];
                                                  if (query.$or) {
                                                      var factor = [];
                                      Severity: Minor
                                      Found in src/data/queries/queries.js - About 1 hr to fix

                                        Function compileQuery has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                compileQuery: function(constrainedQuery, constrainedQueryCapabilities, constrainedQueryFunction, constrainedQueryContext) {
                                                    constrainedQuery = Constrained.rectify(constrainedQuery);
                                                    var sorting_supported = Constrained.sortValidate(constrainedQuery.options, constrainedQueryCapabilities);
                                                    var query_supported = Queries.validate(constrainedQuery.query, constrainedQueryCapabilities.query || {});
                                                    var skip_supported = Constrained.skipValidate(constrainedQuery.options, constrainedQueryCapabilities);
                                        Severity: Minor
                                        Found in src/data/queries/query_engine.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language