betajs/betajs-data

View on GitHub

Showing 81 of 182 total issues

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

            poll: function () {
                if (!this.__ignoreUpdates) {
                    Objs.iter(this.__itemCache, function (cached, id) {
                        this._store.get(id, cached.context).success(function (data) {
                            if (!data)
Severity: Minor
Found in src/data/stores/watchers/poll_watcher.js - About 1 hr to fix

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

                constructor: function (storeInvokee, options) {
                    inherited.constructor.call(this);
                    this.__storeInvokee = storeInvokee;
                    this.__options = Objs.tree_extend({
                        dataMap: {
    Severity: Minor
    Found in src/data/stores/invokers/rest_invokers.js - About 1 hr to fix

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

                  constructor: function (restInvokee, options) {
                      inherited.constructor.call(this);
                      this.__restInvokee = restInvokee;
                      this.__options = Objs.tree_extend({
                          methodMap: {
      Severity: Minor
      Found in src/data/stores/invokers/rest_invokers.js - About 1 hr to fix

        Function mergeConditions has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                mergeConditions: function(conditions1, conditions2) {
                    if (!Types.is_object(conditions1))
                        conditions1 = {
                            "$eq": conditions1
                        };
        Severity: Minor
        Found in src/data/queries/queries.js - About 1 hr to fix

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

                      constructor: function(store, model_type, options) {
                          inherited.constructor.call(this);
                          this.__store = store;
                          this.__model_type = model_type;
                          this.__options = Objs.extend({
          Severity: Minor
          Found in src/modelling/tables.js - About 1 hr to fix

            Function sourceRemove has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        sourceRemove: function (id, data) {
                            return this.criticalSection("commit", function () {
                                this.commitId++;
                                var cont = Promise.create();
                                if (this._options.combine_insert_remove) {
            Severity: Minor
            Found in src/data/stores/base/store_history.js - About 1 hr to fix

              Function cacheUpdate has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          cacheUpdate: function (id, data, options, ctx, transaction_id) {
                              var foreignKey = options.foreignKey && this._foreignKey;
                              var idKey = foreignKey ? this.remoteStore.id_key() : this.id_key();
                              var itemPromise = foreignKey ?
                                                this.itemCache.getBy(this.remoteStore.id_key(), id, ctx)
              Severity: Minor
              Found in src/data/stores/partial/cached_store.js - About 1 hr to fix

                Function simplifyConditions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        simplifyConditions: function(conditions) {
                            var result = {};
                            Objs.iter(["", "ic"], function(add) {
                                if (conditions["$eq" + add] || conditions["$in" + add]) {
                                    var filtered = Objs.filter(conditions["$eq" + add] ? [conditions["$eq" + add]] : conditions["$in" + add], function(inkey) {
                Severity: Minor
                Found in src/data/queries/queries.js - About 1 hr to fix

                  Function indexQueryConditionsSize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          indexQueryConditionsSize: function(conds, index, ignoreCase) {
                              var postfix = ignoreCase ? "_ic" : "";
                              var info = index.info();
                              var subSize = info.row_count;
                              var rows_per_key = info.row_count / Math.max(info["key_count" + postfix], 1);
                  Severity: Minor
                  Found in src/data/queries/query_engine.js - About 1 hr to fix

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

                                constructor: function (storeInvokee, options) {
                                    inherited.constructor.call(this, storeInvokee, Objs.tree_extend({
                                        baseURI: "/",
                                        methodMap: {
                                            "insert": "POST",
                    Severity: Minor
                    Found in src/data/stores/invokers/rest_invokers.js - About 1 hr to fix

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

                                  constructor: function (remoteStore, options) {
                                      inherited.constructor.call(this);
                                      this.remoteStore = remoteStore;
                                      this.__remoteQueryAggregate = Promise.aggregateExecution(this.remoteStore.query, this.remoteStore, null, function (data) {
                                          return data ? data.asArray() : data;
                      Severity: Minor
                      Found in src/data/stores/partial/cached_store.js - About 1 hr to fix

                        Function compileIndexedQuery has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                compileIndexedQuery: function(constrainedQuery, constrainedQueryCapabilities, constrainedQueryFunction, constrainedQueryContext, indices) {
                                    constrainedQuery = Constrained.rectify(constrainedQuery);
                                    indices = indices || {};
                                    if (this.queryPartially(constrainedQuery, constrainedQueryCapabilities) || Types.is_empty(indices))
                                        return this.compileQuery(constrainedQuery, constrainedQueryCapabilities, constrainedQueryFunction, constrainedQueryContext);
                        Severity: Minor
                        Found in src/data/queries/query_engine.js - About 1 hr to fix

                          Function _query has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      _query: function (query, options) {
                                          return Promise.tryCatch(function () {
                                              var iter = new Iterator();
                                              var store = this;
                                              var fid = this._read_first_id();
                          Severity: Minor
                          Found in src/data/stores/dumb/dumb_store.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

                                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 _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

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                        if (Math.sign((index.comparator())(currentKey, lastKey)) === Math.sign(primarySortDirection))
                                                                            return null;
                                        Severity: Major
                                        Found in src/data/queries/query_engine.js - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language