Showing 81 of 182 total issues
Function poll
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
poll: function () {
if (!this.__ignoreUpdates) {
Objs.iter(this.__itemCache, function (cached, id) {
this._store.get(id, cached.context).success(function (data) {
if (!data)
Function constructor
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function (storeInvokee, options) {
inherited.constructor.call(this);
this.__storeInvokee = storeInvokee;
this.__options = Objs.tree_extend({
dataMap: {
Function constructor
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function (restInvokee, options) {
inherited.constructor.call(this);
this.__restInvokee = restInvokee;
this.__options = Objs.tree_extend({
methodMap: {
Function mergeConditions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mergeConditions: function(conditions1, conditions2) {
if (!Types.is_object(conditions1))
conditions1 = {
"$eq": conditions1
};
Function constructor
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function(store, model_type, options) {
inherited.constructor.call(this);
this.__store = store;
this.__model_type = model_type;
this.__options = Objs.extend({
Function sourceRemove
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sourceRemove: function (id, data) {
return this.criticalSection("commit", function () {
this.commitId++;
var cont = Promise.create();
if (this._options.combine_insert_remove) {
Function cacheUpdate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function simplifyConditions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function indexQueryConditionsSize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function (storeInvokee, options) {
inherited.constructor.call(this, storeInvokee, Objs.tree_extend({
baseURI: "/",
methodMap: {
"insert": "POST",
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function compileIndexedQuery
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function _query
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_query: function (query, options) {
return Promise.tryCatch(function () {
var iter = new Iterator();
var store = this;
var fid = this._read_first_id();
Function remotePromise
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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,
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
var gruntHelper = require('betajs-compile');
var dist = 'betajs-data';
Function migrate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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];
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function(table, query, queryopts, options) {
inherited.constructor.call(this);
this._options = options || {};
this._table = table;
this._query = query;
Function _remove
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_remove: function (id) {
return Promise.tryCatch(function () {
var row = this._read_item(id);
if (row) {
this._remove_item(id);
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function(store, key, compare, options) {
inherited.constructor.call(this);
this._options = Objs.extend({
exact: true,
ignoreCase: false
Avoid deeply nested control flow statements. Open
Open
if (Math.sign((index.comparator())(currentKey, lastKey)) === Math.sign(primarySortDirection))
return null;