huridocs/uwazi

View on GitHub

Showing 3,439 of 3,635 total issues

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

describe('migration thesaurus_group_child_id_fix', () => {
  let db;
  let dicts;
  let newIdForA;
  let newIdForB;
app/api/migrations/migrations/125-thesaurus_group_child_id_fix/specs/125-thesaurus_group_child_id_fix.spec.js on lines 13..398

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 1980.

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

describe('migration thesaurus_group_child_id_fix', () => {
  let db;
  let dicts;
  let newIdForA;
  let newIdForB;
app/api/migrations/migrations/126-thesaurus_group_child_id_fix_2/specs/126-thesaurus_group_child_id_fix.spec.js on lines 13..398

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 1980.

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 default {
  delta: 166,

  name: 'remove_inconsistent_relationships_metadata',

app/api/migrations/migrations/149-remove_inconsistent_relationships_metadata/index.ts on lines 12..152

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 1436.

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 default {
  delta: 149,

  name: 'remove_inconsistent_relationships_metadata',

app/api/migrations/migrations/166-remove_inconsistent_relationships_metadata/index.ts on lines 12..152

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 1436.

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

describe('migration repair_select_parent_denormalization', () => {
  it('should have a delta number', () => {
    expect(migration.delta).toBe(165);
  });

app/api/migrations/migrations/154-repair_select_parent_denormalization/specs/154-repair_select_parent_denormalization.spec.ts on lines 95..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 1012.

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

describe('migration repair_select_parent_denormalization', () => {
  it('should have a delta number', () => {
    expect(migration.delta).toBe(154);
  });

app/api/migrations/migrations/165-repair_select_parent_denormalization/specs/165-repair_select_parent_denormalization.spec.ts on lines 95..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 1012.

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

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

  entities: [
    {
      title: 'ent1',
      shareId: 'ent1',
      language: 'es',
Severity: Major
Found in app/api/search.v2/specs/permissionsFiltersFixtures.ts and 1 other location - About 4 days to fix
app/api/search/specs/permissionsFiltersFixtures.ts on lines 43..126

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 772.

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

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

  entities: [
    {
      title: 'ent1',
      shareId: 'ent1',
      language: 'es',
Severity: Major
Found in app/api/search/specs/permissionsFiltersFixtures.ts and 1 other location - About 4 days to fix
app/api/search.v2/specs/permissionsFiltersFixtures.ts on lines 43..126

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 772.

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

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

const oneLanguageFixtures: Fixture = {
  dictionaries: [
    {
      _id: ids.dict,
      name: 'dict',
app/api/migrations/migrations/154-repair_select_parent_denormalization/specs/fixtures.ts on lines 312..469

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 651.

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

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

const oneLanguageFixtures: Fixture = {
  dictionaries: [
    {
      _id: ids.dict,
      name: 'dict',
app/api/migrations/migrations/165-repair_select_parent_denormalization/specs/fixtures.ts on lines 312..469

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 651.

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

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

const noReindexFixtures: FixtureType = {
  relationTypes: [{ _id: ids.relationType, name: 'relation_type' }],
  templates: [
    {
      _id: ids.unrelatedTemplate,
app/api/migrations/migrations/149-remove_inconsistent_relationships_metadata/specs/fixtures.ts on lines 29..150

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 558.

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

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

const noReindexFixtures: FixtureType = {
  relationTypes: [{ _id: ids.relationType, name: 'relation_type' }],
  templates: [
    {
      _id: ids.unrelatedTemplate,
app/api/migrations/migrations/166-remove_inconsistent_relationships_metadata/specs/fixtures.ts on lines 29..150

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 558.

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

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

const baseEntities = {
  correct1: {
    title: 'entity_with_correct_selects',
    language: 'en',
    sharedId: 'entity_with_correct_selects',
app/api/migrations/migrations/165-repair_select_parent_denormalization/specs/fixtures.ts on lines 141..263

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 481.

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

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

const baseEntities = {
  correct1: {
    title: 'entity_with_correct_selects',
    language: 'en',
    sharedId: 'entity_with_correct_selects',
app/api/migrations/migrations/154-repair_select_parent_denormalization/specs/fixtures.ts on lines 141..263

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 481.

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 44 locations. Consider refactoring.
Open

describe('migration add_system_key_translations', () => {
  beforeEach(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.clearAllAndLoad(fixtures);
  });
app/api/migrations/migrations/100-add_system_key_translations/specs/100-add_system_key_translations.spec.js on lines 22..67
app/api/migrations/migrations/102-add_system_key_translations/specs/102-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/104-add_system_key_translations/specs/104-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/105-add_system_key_translations/specs/105-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/107-add_system_key_translations/specs/107-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/108-add_system_key_translations/specs/108-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/109-add_system_key_translations/specs/109-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/111-add_system_key_translations/specs/111-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/112-add_system_key_translations/specs/112-add_system_key_translations.spec.js on lines 36..81
app/api/migrations/migrations/114-add_system_key_translations/specs/114-add_system_key_translations.spec.js on lines 51..96
app/api/migrations/migrations/116-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/117-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/118-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 24..69
app/api/migrations/migrations/120-add_system_key_translations/specs/120-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/130-add_system_key_translations/specs/130-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/132-add_system_key_translations/specs/132-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/135-add_system_key_translations/specs/135-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/54-add_system_key_translations/specs/54-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/56-add_system_key_translations/specs/56-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/57-add_system_key_translations/specs/57-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/61-add_system_key_translations/specs/61-add_system_key_translations.spec.js on lines 75..120
app/api/migrations/migrations/62-add_system_key_translations/specs/62-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/65-add_system_key_translations/specs/65-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/66-add_system_key_translations/specs/66-add_system_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/67-add_system_key_translations/specs/67-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/68-add_system_key_translations/specs/68-add_system_key_translations.spec.js on lines 22..67
app/api/migrations/migrations/71-add_system_key_translations/specs/71-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/72-add_system_key_translations/specs/72-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/75-add_system_key_translations/specs/75-add_system_key_translations.spec.js on lines 43..88
app/api/migrations/migrations/77-add_system_key_translations/specs/77-add_system_key_translations.spec.js on lines 99..144
app/api/migrations/migrations/79-add_system_key_translations/specs/79-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/81-add_system_key_translations/specs/81-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/84-add_system_key_translations/specs/84-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/85-add_system_key_translations/specs/85-add_system_key_translations.spec.js on lines 40..85
app/api/migrations/migrations/88-add_system_key_translations/specs/88-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/90-add_system_key_translations/specs/90-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/91-add_system_key_translations/specs/91-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/92-add_system_key_translations/specs/92-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/95-add_ix_key_translations/specs/95-add_ix_key_translations.spec.js on lines 33..78
app/api/migrations/migrations/96-add_ix_key_translations/specs/96-add_ix_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/97-add_ix_key_translations/specs/97-add_ix_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/98-add_ix_key_translations/specs/98-add_ix_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/99-add_ix_key_translations/specs/99-add_ix_key_translations.spec.js on lines 31..76

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 498.

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 44 locations. Consider refactoring.
Open

describe('migration add_system_key_translations', () => {
  beforeEach(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
  });
app/api/migrations/migrations/100-add_system_key_translations/specs/100-add_system_key_translations.spec.js on lines 22..67
app/api/migrations/migrations/102-add_system_key_translations/specs/102-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/104-add_system_key_translations/specs/104-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/105-add_system_key_translations/specs/105-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/107-add_system_key_translations/specs/107-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/108-add_system_key_translations/specs/108-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/109-add_system_key_translations/specs/109-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/111-add_system_key_translations/specs/111-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/112-add_system_key_translations/specs/112-add_system_key_translations.spec.js on lines 36..81
app/api/migrations/migrations/114-add_system_key_translations/specs/114-add_system_key_translations.spec.js on lines 51..96
app/api/migrations/migrations/116-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/117-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/118-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 24..69
app/api/migrations/migrations/120-add_system_key_translations/specs/120-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/124-add_ix_key_translations/specs/124-add_ix_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/132-add_system_key_translations/specs/132-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/135-add_system_key_translations/specs/135-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/54-add_system_key_translations/specs/54-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/56-add_system_key_translations/specs/56-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/57-add_system_key_translations/specs/57-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/61-add_system_key_translations/specs/61-add_system_key_translations.spec.js on lines 75..120
app/api/migrations/migrations/62-add_system_key_translations/specs/62-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/65-add_system_key_translations/specs/65-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/66-add_system_key_translations/specs/66-add_system_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/67-add_system_key_translations/specs/67-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/68-add_system_key_translations/specs/68-add_system_key_translations.spec.js on lines 22..67
app/api/migrations/migrations/71-add_system_key_translations/specs/71-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/72-add_system_key_translations/specs/72-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/75-add_system_key_translations/specs/75-add_system_key_translations.spec.js on lines 43..88
app/api/migrations/migrations/77-add_system_key_translations/specs/77-add_system_key_translations.spec.js on lines 99..144
app/api/migrations/migrations/79-add_system_key_translations/specs/79-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/81-add_system_key_translations/specs/81-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/84-add_system_key_translations/specs/84-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/85-add_system_key_translations/specs/85-add_system_key_translations.spec.js on lines 40..85
app/api/migrations/migrations/88-add_system_key_translations/specs/88-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/90-add_system_key_translations/specs/90-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/91-add_system_key_translations/specs/91-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/92-add_system_key_translations/specs/92-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/95-add_ix_key_translations/specs/95-add_ix_key_translations.spec.js on lines 33..78
app/api/migrations/migrations/96-add_ix_key_translations/specs/96-add_ix_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/97-add_ix_key_translations/specs/97-add_ix_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/98-add_ix_key_translations/specs/98-add_ix_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/99-add_ix_key_translations/specs/99-add_ix_key_translations.spec.js on lines 31..76

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 498.

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 44 locations. Consider refactoring.
Open

describe('migration add_system_key_translations', () => {
  beforeEach(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
  });
app/api/migrations/migrations/100-add_system_key_translations/specs/100-add_system_key_translations.spec.js on lines 22..67
app/api/migrations/migrations/102-add_system_key_translations/specs/102-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/104-add_system_key_translations/specs/104-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/105-add_system_key_translations/specs/105-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/107-add_system_key_translations/specs/107-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/108-add_system_key_translations/specs/108-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/109-add_system_key_translations/specs/109-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/111-add_system_key_translations/specs/111-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/112-add_system_key_translations/specs/112-add_system_key_translations.spec.js on lines 36..81
app/api/migrations/migrations/114-add_system_key_translations/specs/114-add_system_key_translations.spec.js on lines 51..96
app/api/migrations/migrations/116-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/117-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/118-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 24..69
app/api/migrations/migrations/120-add_system_key_translations/specs/120-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/124-add_ix_key_translations/specs/124-add_ix_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/130-add_system_key_translations/specs/130-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/135-add_system_key_translations/specs/135-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/54-add_system_key_translations/specs/54-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/56-add_system_key_translations/specs/56-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/57-add_system_key_translations/specs/57-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/61-add_system_key_translations/specs/61-add_system_key_translations.spec.js on lines 75..120
app/api/migrations/migrations/62-add_system_key_translations/specs/62-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/65-add_system_key_translations/specs/65-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/66-add_system_key_translations/specs/66-add_system_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/67-add_system_key_translations/specs/67-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/68-add_system_key_translations/specs/68-add_system_key_translations.spec.js on lines 22..67
app/api/migrations/migrations/71-add_system_key_translations/specs/71-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/72-add_system_key_translations/specs/72-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/75-add_system_key_translations/specs/75-add_system_key_translations.spec.js on lines 43..88
app/api/migrations/migrations/77-add_system_key_translations/specs/77-add_system_key_translations.spec.js on lines 99..144
app/api/migrations/migrations/79-add_system_key_translations/specs/79-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/81-add_system_key_translations/specs/81-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/84-add_system_key_translations/specs/84-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/85-add_system_key_translations/specs/85-add_system_key_translations.spec.js on lines 40..85
app/api/migrations/migrations/88-add_system_key_translations/specs/88-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/90-add_system_key_translations/specs/90-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/91-add_system_key_translations/specs/91-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/92-add_system_key_translations/specs/92-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/95-add_ix_key_translations/specs/95-add_ix_key_translations.spec.js on lines 33..78
app/api/migrations/migrations/96-add_ix_key_translations/specs/96-add_ix_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/97-add_ix_key_translations/specs/97-add_ix_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/98-add_ix_key_translations/specs/98-add_ix_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/99-add_ix_key_translations/specs/99-add_ix_key_translations.spec.js on lines 31..76

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 498.

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 44 locations. Consider refactoring.
Open

describe('migration add_system_key_translations', () => {
  beforeEach(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
  });
app/api/migrations/migrations/100-add_system_key_translations/specs/100-add_system_key_translations.spec.js on lines 22..67
app/api/migrations/migrations/102-add_system_key_translations/specs/102-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/104-add_system_key_translations/specs/104-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/105-add_system_key_translations/specs/105-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/107-add_system_key_translations/specs/107-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/108-add_system_key_translations/specs/108-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/109-add_system_key_translations/specs/109-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/111-add_system_key_translations/specs/111-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/112-add_system_key_translations/specs/112-add_system_key_translations.spec.js on lines 36..81
app/api/migrations/migrations/114-add_system_key_translations/specs/114-add_system_key_translations.spec.js on lines 51..96
app/api/migrations/migrations/116-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/117-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/118-add_system_key_translations/specs/116-add_system_key_translations.spec.js on lines 24..69
app/api/migrations/migrations/120-add_system_key_translations/specs/120-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/124-add_ix_key_translations/specs/124-add_ix_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/130-add_system_key_translations/specs/130-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/132-add_system_key_translations/specs/132-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/54-add_system_key_translations/specs/54-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/56-add_system_key_translations/specs/56-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/57-add_system_key_translations/specs/57-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/61-add_system_key_translations/specs/61-add_system_key_translations.spec.js on lines 75..120
app/api/migrations/migrations/62-add_system_key_translations/specs/62-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/65-add_system_key_translations/specs/65-add_system_key_translations.spec.js on lines 35..80
app/api/migrations/migrations/66-add_system_key_translations/specs/66-add_system_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/67-add_system_key_translations/specs/67-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/68-add_system_key_translations/specs/68-add_system_key_translations.spec.js on lines 22..67
app/api/migrations/migrations/71-add_system_key_translations/specs/71-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/72-add_system_key_translations/specs/72-add_system_key_translations.spec.js on lines 31..76
app/api/migrations/migrations/75-add_system_key_translations/specs/75-add_system_key_translations.spec.js on lines 43..88
app/api/migrations/migrations/77-add_system_key_translations/specs/77-add_system_key_translations.spec.js on lines 99..144
app/api/migrations/migrations/79-add_system_key_translations/specs/79-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/81-add_system_key_translations/specs/81-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/84-add_system_key_translations/specs/84-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/85-add_system_key_translations/specs/85-add_system_key_translations.spec.js on lines 40..85
app/api/migrations/migrations/88-add_system_key_translations/specs/88-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/90-add_system_key_translations/specs/90-add_system_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/91-add_system_key_translations/specs/91-add_system_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/92-add_system_key_translations/specs/92-add_system_key_translations.spec.js on lines 20..65
app/api/migrations/migrations/95-add_ix_key_translations/specs/95-add_ix_key_translations.spec.js on lines 33..78
app/api/migrations/migrations/96-add_ix_key_translations/specs/96-add_ix_key_translations.spec.js on lines 27..72
app/api/migrations/migrations/97-add_ix_key_translations/specs/97-add_ix_key_translations.spec.js on lines 23..68
app/api/migrations/migrations/98-add_ix_key_translations/specs/98-add_ix_key_translations.spec.js on lines 19..64
app/api/migrations/migrations/99-add_ix_key_translations/specs/99-add_ix_key_translations.spec.js on lines 31..76

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 498.

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

describe('migration update translations of new Translations UI', () => {
  beforeEach(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
  });
app/api/migrations/migrations/134-update_translations/specs/134-update_translations.spec.js on lines 5..68

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 486.

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

describe('migration update translations of new Languages UI', () => {
  beforeEach(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
  });
app/api/migrations/migrations/131-update_translations/specs/131-update_translations.spec.js on lines 5..68

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 486.

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