Showing 81 of 182 total issues
File queries.js
has 546 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
Scoped.define("module:Queries", [
"base:Types",
"base:Sort",
"base:Objs",
"base:Class",
File cached_store.js
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
*
File abstract_query_collection.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
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.
File contextualized_store.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
Scoped.define("module:Stores.ContextualizedStore", [
"module:Stores.BaseStore",
"base:Iterators.MappedIterator"
], function (BaseStore, MappedIterator, scoped) {
return BaseStore.extend({scoped: scoped}, function (inherited) {
Function compileIndexQuery
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
File partial_store_write_strategies.js
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
Scoped.define("module:Stores.PartialStoreWriteStrategies.WriteStrategy", [
"base:Class"
], function (Class, scoped) {
return Class.extend({scoped: scoped}, function (inherited) {
return {
Function constructor
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function(attributes, collection) {
inherited.constructor.call(this, attributes);
var silent = false;
var items = collection || this.auto_destroy(new Collection());
Function push
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
push: function () {
if (this.pushing)
return Promise.value(true);
var failedIds = {};
var unlockIds = {};
Function rangeSuperQueryDiffQuery
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
rangeSuperQueryDiffQuery: function(superCandidate, subCandidate) {
if (!Objs.keyEquals(superCandidate, subCandidate))
return false;
var rangeKey = Objs.objectify(["$gt", "$lt", "$gte", "$lte"]);
var ors = [];
Function constructor
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor: function(source, query, options) {
options = options || {};
inherited.constructor.call(this, {
release_references: true,
uniqueness: options.uniqueness,
Function next
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var next = function () {
if (!iter.hasNext()) {
iter.destroy();
this.pushing = false;
this.storeHistory.unlockCommits();
Function iterResult
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
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]) {
Function cacheQuery
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
cacheQuery: function (query, queryOptions, options, ctx) {
var queryString = Constrained.serialize({
query: query,
options: queryOptions
});
File query_engine.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
Scoped.define("module:Queries.Engine", [
"module:Queries",
"module:Queries.Constrained",
"base:Strings",
"base:Types",
Function save
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function cacheGet
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function __update
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function sourceUpdate
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
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";
Function disjunctiveNormalForm
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
disjunctiveNormalForm: function(query, mergeKeys) {
query = Objs.clone(query, 1);
var factors = [];
if (query.$or) {
var factor = [];
Function compileQuery
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);