huridocs/uwazi

View on GitHub

Showing 522 of 3,516 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/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

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

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

  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

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

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('modal', () => {
    beforeEach(() => {
      spyOn(thesaurusActions, 'saveThesaurus').and.returnValue({ type: 'saved' });
      render();
      const button = screen.getByRole('button');
app/react/RelationTypes/components/specs/AddRelationshipTypeButton.spec.tsx on lines 33..85

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('modal', () => {
    beforeEach(() => {
      spyOn(relationTypeActions, 'saveRelationType').and.returnValue({ type: 'saved' });
      render();
      const button = screen.getByRole('button');
app/react/Thesauri/components/specs/AddThesaurusButton.spec.tsx on lines 38..88

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

describe('migration update translations of settings new Users/Groups UI', () => {
  beforeAll(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
    await migration.up(testingDB.mongodb);
app/api/migrations/migrations/148-update_translations/specs/148-update_translations.spec.js on lines 5..50
app/api/migrations/migrations/152-update_translations/specs/152-update_translations.spec.js on lines 5..50
app/api/migrations/migrations/157-update_translations/specs/update_translations.spec.js on lines 5..50

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

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

describe('migration update translations of settings new Users/Groups UI', () => {
  beforeAll(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
    await migration.up(testingDB.mongodb);
app/api/migrations/migrations/152-update_translations/specs/152-update_translations.spec.js on lines 5..50
app/api/migrations/migrations/155-update_translations/specs/155-update_translations.spec.js on lines 5..50
app/api/migrations/migrations/157-update_translations/specs/update_translations.spec.js on lines 5..50

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

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

describe('migration update translations of settings new Users/Groups UI', () => {
  beforeAll(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
    await migration.up(testingDB.mongodb);
app/api/migrations/migrations/148-update_translations/specs/148-update_translations.spec.js on lines 5..50
app/api/migrations/migrations/152-update_translations/specs/152-update_translations.spec.js on lines 5..50
app/api/migrations/migrations/155-update_translations/specs/155-update_translations.spec.js on lines 5..50

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

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

describe('migration update translations of settings new Users/Groups UI', () => {
  beforeAll(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
    await testingDB.setupFixturesAndContext(fixtures);
    await migration.up(testingDB.mongodb);
app/api/migrations/migrations/148-update_translations/specs/148-update_translations.spec.js on lines 5..50
app/api/migrations/migrations/155-update_translations/specs/155-update_translations.spec.js on lines 5..50
app/api/migrations/migrations/157-update_translations/specs/update_translations.spec.js on lines 5..50

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

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

describe('migration update translations of settings', () => {
  beforeAll(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation((_str: string | Uint8Array) => true);
    await initTest(fixtures);
  });
app/api/migrations/migrations/158-update-translations/specs/158-update_translations.spec.ts on lines 15..59
app/api/migrations/migrations/160-update-translations/specs/160-update_translations.spec.ts on lines 15..59
app/api/migrations/migrations/164-update-translations/specs/164-update_translations.spec.ts on lines 15..59

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

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

describe('migration update translations of settings', () => {
  beforeAll(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation((_str: string | Uint8Array) => true);
    await initTest(fixtures);
  });
app/api/migrations/migrations/158-update-translations/specs/158-update_translations.spec.ts on lines 15..59
app/api/migrations/migrations/161-update-translations/specs/161-update_translations.spec.ts on lines 15..59
app/api/migrations/migrations/164-update-translations/specs/164-update_translations.spec.ts on lines 15..59

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

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

describe('migration update translations of settings', () => {
  beforeAll(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation((_str: string | Uint8Array) => true);
    await initTest(fixtures);
  });
app/api/migrations/migrations/160-update-translations/specs/160-update_translations.spec.ts on lines 15..59
app/api/migrations/migrations/161-update-translations/specs/161-update_translations.spec.ts on lines 15..59
app/api/migrations/migrations/164-update-translations/specs/164-update_translations.spec.ts on lines 15..59

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

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

describe('migration update translations of settings', () => {
  beforeAll(async () => {
    jest.spyOn(process.stdout, 'write').mockImplementation((_str: string | Uint8Array) => true);
    await initTest(fixtures);
  });
app/api/migrations/migrations/158-update-translations/specs/158-update_translations.spec.ts on lines 15..59
app/api/migrations/migrations/160-update-translations/specs/160-update_translations.spec.ts on lines 15..59
app/api/migrations/migrations/161-update-translations/specs/161-update_translations.spec.ts on lines 15..59

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

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