emberjs/data

View on GitHub

Showing 90 of 251 total issues

CoreStore has 79 functions (exceeds 50 allowed). Consider refactoring.
Open

abstract class CoreStore extends Service {
  /**
   * EmberData specific backburner instance
   * @property _backburner
   * @private
Severity: Major
Found in packages/store/addon/-private/system/core-store.ts - About 6 hrs to fix

    InternalModel has 67 functions (exceeds 50 allowed). Consider refactoring.
    Open

    export default class InternalModel {
      declare _id: string | null;
      declare modelName: string;
      declare clientId: string;
      declare __recordData: RecordData | null;
    Severity: Major
    Found in packages/store/addon/-private/system/model/internal-model.ts - About 4 hrs to fix

      Model has 58 functions (exceeds 50 allowed). Consider refactoring.
      Open

      class Model extends EmberObject {
        init(...args) {
          super.init(...args);
      
          if (DEBUG) {
      Severity: Major
      Found in packages/model/addon/-private/model.js - About 3 hrs to fix

        Consider simplifying this complex logical expression.
        Open

            if (HAS_RECORD_DATA_PACKAGE) {
              if (!resource) {
                return resolve([]);
              }
              const { definition, state } = relationship;
        Severity: Critical
        Found in packages/store/addon/-private/system/core-store.ts - About 3 hrs to fix

          Function addonBuildConfigForDataPackage has 157 lines of code (exceeds 100 allowed). Consider refactoring.
          Open

          function addonBuildConfigForDataPackage(PackageName) {
            return {
              name: PackageName,
          
              init() {

            Function serializerFor has 132 lines of code (exceeds 100 allowed). Consider refactoring.
            Open

              serializerFor(modelName) {
                if (DEBUG) {
                  assertDestroyingStore(this, 'serializerFor');
                }
                assert(`You need to pass a model name to the store's serializerFor method`, isPresent(modelName));
            Severity: Major
            Found in packages/store/addon/-private/system/core-store.ts - About 2 hrs to fix

              Function upgradeDefinition has 124 lines of code (exceeds 100 allowed). Consider refactoring.
              Open

              export function upgradeDefinition(
                graph: Graph,
                identifier: StableRecordIdentifier,
                propertyName: string,
                isImplicit: boolean = false
              Severity: Major
              Found in packages/record-data/addon/-private/graph/-edge-definition.ts - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                if (DEBUG) {
                  let lookupDescriptor = function lookupDescriptor(obj, keyName) {
                    let current = obj;
                    do {
                      let descriptor = Object.getOwnPropertyDescriptor(current, keyName);
                Severity: Critical
                Found in packages/model/addon/-private/model.js - About 1 hr to fix

                  Function _flushPendingFetchForType has 107 lines of code (exceeds 100 allowed). Consider refactoring.
                  Open

                    _flushPendingFetchForType(pendingFetchItems: PendingFetchItem[], modelName: string) {
                      let store = this;
                      let adapter = store.adapterFor(modelName);
                      let shouldCoalesce = !!adapter.findMany && adapter.coalesceFindRequests;
                      let totalItems = pendingFetchItems.length;
                  Severity: Major
                  Found in packages/store/addon/-private/system/core-store.ts - About 1 hr to fix

                    Function updateRelationshipOperation has 107 lines of code (exceeds 100 allowed). Consider refactoring.
                    Open

                    export default function updateRelationshipOperation(graph: Graph, op: UpdateRelationshipOperation) {
                      const relationship = graph.get(op.record, op.field);
                      assert(`Cannot update an implicit relationship`, isHasMany(relationship) || isBelongsTo(relationship));
                      const { definition, state, identifier } = relationship;
                      const { isCollection } = definition;

                      Function configureDeprecationHandler has 103 lines of code (exceeds 100 allowed). Consider refactoring.
                      Open

                      export function configureDeprecationHandler() {
                        if (HAS_REGISTERED === true) {
                          throw new Error(`Attempting to re-register the assert-deprecation handler`);
                        }
                        HAS_REGISTERED = true;

                        Function watchTypeIfUnseen has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          watchTypeIfUnseen(store, discoveredTypes, type, typesAdded, typesUpdated, releaseMethods) {
                        Severity: Minor
                        Found in packages/debug/addon/index.js - About 45 mins to fix

                          Function _query has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          export function _query(adapter, store, modelName, query, recordArray, options) {
                          Severity: Minor
                          Found in packages/store/addon/-private/system/store/finders.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if (hasOwnProperty.call(parsedErrors, attribute)) {
                                          this.getRecord().errors._add(attribute, parsedErrors[attribute]);
                                        }
                            Severity: Major
                            Found in packages/store/addon/-private/system/model/internal-model.ts - About 45 mins to fix

                              Function _findMany has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              export function _findMany(adapter, store, modelName, ids, internalModels, optionsMap) {
                              Severity: Minor
                              Found in packages/store/addon/-private/system/store/finders.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            if (relationshipMeta.options.polymorphic) {
                                              for (let i = 0, l = relationshipHash.length; i < l; i++) {
                                                let item = relationshipHash[i];
                                                data[i] = this.extractPolymorphicRelationship(relationshipMeta.type, item, {
                                                  key,
                                Severity: Major
                                Found in packages/serializer/addon/json.js - About 45 mins to fix

                                  Function _find has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  export function _find(adapter, store, modelClass, id, internalModel, options) {
                                  Severity: Minor
                                  Found in packages/store/addon/-private/system/store/finders.js - About 45 mins to fix

                                    Function _findBelongsTo has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    export function _findBelongsTo(adapter, store, internalModel, link, relationship, options) {
                                    Severity: Minor
                                    Found in packages/store/addon/-private/system/store/finders.js - About 45 mins to fix

                                      Function buildURL has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                        this: MixtBuildURLMixin,
                                        modelName: string,
                                        id: string | string[] | Dict<unknown> | null,
                                        snapshot: Snapshot | Snapshot[] | SnapshotRecordArray | null,
                                        requestType?:
                                      Severity: Minor
                                      Found in packages/adapter/addon/-private/build-url-mixin.ts - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                    if (identifier.lid in this._cache.lids) {
                                                      throw new Error(`You should not change the <type> of a RecordIdentifier`);
                                                    }
                                        Severity: Major
                                        Found in packages/store/addon/-private/identifiers/cache.ts - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language