emberjs/data

View on GitHub

Showing 251 of 251 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  for (let i = 0; i < iterationLength; i++) {
    if (i < identifiersLength) {
      const identifier = identifiers[i];
      if (type !== identifier.type) {
        assertPolymorphicType(relationship.identifier, relationship.definition, identifier, graph.store);
packages/record-data/addon/-private/graph/operations/replace-related-records.ts on lines 174..202

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 258.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  for (let i = 0; i < iterationLength; i++) {
    if (i < identifiersLength) {
      const identifier = identifiers[i];
      if (type !== identifier.type) {
        assertPolymorphicType(relationship.identifier, relationship.definition, identifier, graph.store);
packages/record-data/addon/-private/graph/operations/replace-related-records.ts on lines 103..131

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 258.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (DEBUG && HAS_EMBER_DATA_PACKAGE && HAS_SERIALIZER_PACKAGE && serializer === undefined) {
        if (serializerName === '-json-api') {
          const Serializer = require('@ember-data/serializer/json-api').default;
          owner.register(`serializer:-json-api`, Serializer);
          serializer = owner.lookup(`serializer:-json-api`);
Severity: Major
Found in packages/store/addon/-private/system/core-store.ts and 1 other location - About 1 day to fix
packages/store/addon/-private/system/core-store.ts on lines 3639..3656

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 244.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (DEBUG) {
  assertDestroyingStore = function assertDestroyedStore(store, method) {
    if (!store.shouldAssertMethodCallsOnDestroyedStore) {
      deprecate(
        `Attempted to call store.${method}(), but the store instance has already been destroyed.`,
Severity: Major
Found in packages/store/addon/-private/system/core-store.ts and 1 other location - About 1 day to fix
packages/store/addon/-private/system/ds-model-store.ts on lines 188..233

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 244.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (DEBUG) {
  assertDestroyingStore = function assertDestroyedStore(store, method) {
    if (!store.shouldAssertMethodCallsOnDestroyedStore) {
      deprecate(
        `Attempted to call store.${method}(), but the store instance has already been destroyed.`,
Severity: Major
Found in packages/store/addon/-private/system/ds-model-store.ts and 1 other location - About 1 day to fix
packages/store/addon/-private/system/core-store.ts on lines 3971..4016

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 244.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (DEBUG && HAS_EMBER_DATA_PACKAGE && HAS_SERIALIZER_PACKAGE && serializer === undefined) {
        if (normalizedModelName === '-json-api') {
          const Serializer = require('@ember-data/serializer/json-api').default;
          owner.register(`serializer:-json-api`, Serializer);
          serializer = owner.lookup(`serializer:-json-api`);
Severity: Major
Found in packages/store/addon/-private/system/core-store.ts and 1 other location - About 1 day to fix
packages/store/addon/-private/system/core-store.ts on lines 3703..3720

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 244.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

module.exports = function (environment) {
  let ENV = {
    modulePrefix: 'serializer-encapsulation-test-app',
    environment,
    rootURL: '/',
packages/unpublished-adapter-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-debug-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-fastboot-test-app/config/environment.js on lines 3..51
packages/unpublished-model-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-record-data-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-relationship-performance-test-app/config/environment.js on lines 3..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 203.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

module.exports = function (environment) {
  let ENV = {
    modulePrefix: 'debug-encapsulation-test-app',
    environment,
    rootURL: '/',
packages/unpublished-adapter-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-fastboot-test-app/config/environment.js on lines 3..51
packages/unpublished-model-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-record-data-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-relationship-performance-test-app/config/environment.js on lines 3..51
packages/unpublished-serializer-encapsulation-test-app/config/environment.js on lines 3..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 203.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

module.exports = function (environment) {
  let ENV = {
    modulePrefix: 'model-encapsulation-test-app',
    environment,
    rootURL: '/',
packages/unpublished-adapter-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-debug-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-fastboot-test-app/config/environment.js on lines 3..51
packages/unpublished-record-data-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-relationship-performance-test-app/config/environment.js on lines 3..51
packages/unpublished-serializer-encapsulation-test-app/config/environment.js on lines 3..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 203.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

module.exports = function (environment) {
  let ENV = {
    modulePrefix: 'relationship-performance-test-app',
    environment,
    rootURL: '/',
packages/unpublished-adapter-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-debug-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-fastboot-test-app/config/environment.js on lines 3..51
packages/unpublished-model-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-record-data-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-serializer-encapsulation-test-app/config/environment.js on lines 3..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 203.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

module.exports = function (environment) {
  let ENV = {
    modulePrefix: 'fastboot-test-app',
    environment,
    rootURL: '/',
packages/unpublished-adapter-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-debug-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-model-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-record-data-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-relationship-performance-test-app/config/environment.js on lines 3..51
packages/unpublished-serializer-encapsulation-test-app/config/environment.js on lines 3..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 203.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

module.exports = function (environment) {
  let ENV = {
    modulePrefix: 'adapter-encapsulation-test-app',
    environment,
    rootURL: '/',
packages/unpublished-debug-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-fastboot-test-app/config/environment.js on lines 3..51
packages/unpublished-model-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-record-data-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-relationship-performance-test-app/config/environment.js on lines 3..51
packages/unpublished-serializer-encapsulation-test-app/config/environment.js on lines 3..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 203.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

module.exports = function (environment) {
  let ENV = {
    modulePrefix: 'record-data-encapsulation-test-app',
    environment,
    rootURL: '/',
packages/unpublished-adapter-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-debug-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-fastboot-test-app/config/environment.js on lines 3..51
packages/unpublished-model-encapsulation-test-app/config/environment.js on lines 3..51
packages/unpublished-relationship-performance-test-app/config/environment.js on lines 3..51
packages/unpublished-serializer-encapsulation-test-app/config/environment.js on lines 3..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 203.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      eachAttribute(callback: (key: string, meta: AttributeSchema) => void, binding?: unknown): void {
        if (CUSTOM_MODEL_CLASS) {
          let attrDefs = this._store._attributesDefinitionFor(this.modelName, this.identifier);
          Object.keys(attrDefs).forEach((key) => {
            callback.call(binding, key, attrDefs[key] as AttributeSchema);
    Severity: Major
    Found in packages/store/addon/-private/system/snapshot.ts and 1 other location - About 5 hrs to fix
    packages/store/addon/-private/system/snapshot.ts on lines 519..529

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 154.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      eachRelationship(callback: (key: string, meta: RelationshipSchema) => void, binding?: unknown): void {
        if (CUSTOM_MODEL_CLASS) {
          let relationshipDefs = this._store._relationshipsDefinitionFor(this.modelName, this.identifier);
          Object.keys(relationshipDefs).forEach((key) => {
            callback.call(binding, key, relationshipDefs[key] as RelationshipSchema);
    Severity: Major
    Found in packages/store/addon/-private/system/snapshot.ts and 1 other location - About 5 hrs to fix
    packages/store/addon/-private/system/snapshot.ts on lines 490..500

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 154.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export function isLHS(info: EdgeDefinition, type: string, key: string): boolean {
        let isSelfReferential = info.isSelfReferential;
        let isRelationship = key === info.lhs_relationshipName;
      
        if (isRelationship === true) {
      packages/record-data/addon/-private/graph/-edge-definition.ts on lines 104..118

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 128.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export function isRHS(info: EdgeDefinition, type: string, key: string): boolean {
        let isSelfReferential = info.isSelfReferential;
        let isRelationship = key === info.rhs_relationshipName;
      
        if (isRelationship === true) {
      packages/record-data/addon/-private/graph/-edge-definition.ts on lines 88..102

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 128.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        eachAttribute<T>(callback: (this: T | undefined, key: string, attribute: AttributeSchema) => void, binding?: T) {
          let attrDefs = this.__store._attributesDefinitionFor(this.modelName);
          Object.keys(attrDefs).forEach((key) => {
            callback.call(binding, key, attrDefs[key] as AttributeSchema);
          });
      packages/store/addon/-private/system/model/shim-model-class.ts on lines 65..73

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 122.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language