Showing 313 of 321 total issues

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

    describe('delete()', () => {
        beforeEach(() => {
            apiMock.delete.mockReturnValueOnce(Promise.resolve())
        })

Severity: Major
Found in src/datastore/__tests__/UserDataStore.spec.js and 1 other location - About 4 hrs to fix
src/datastore/__tests__/DataStore.spec.js on lines 129..143

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

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

        withProgramStatus(value) {
            const programStatus = value.toUpperCase()

            const programStatuses = new Set([
                'ACTIVE',
Severity: Major
Found in src/analytics/AnalyticsRequestPropertiesMixin.js and 2 other locations - About 4 hrs to fix
src/analytics/AnalyticsRequestPropertiesMixin.js on lines 633..648
src/analytics/AnalyticsRequestPropertiesMixin.js on lines 816..835

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

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

        withOutputType(value) {
            const type = value.toUpperCase()

            const outputTypes = new Set([
                'EVENT',
Severity: Major
Found in src/analytics/AnalyticsRequestPropertiesMixin.js and 2 other locations - About 4 hrs to fix
src/analytics/AnalyticsRequestPropertiesMixin.js on lines 601..620
src/analytics/AnalyticsRequestPropertiesMixin.js on lines 633..648

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

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

        withOuMode(value) {
            const ouMode = value.toUpperCase()

            const ouModes = new Set(['DESCENDANTS', 'CHILDREN', 'SELECTED'])

Severity: Major
Found in src/analytics/AnalyticsRequestPropertiesMixin.js and 2 other locations - About 4 hrs to fix
src/analytics/AnalyticsRequestPropertiesMixin.js on lines 601..620
src/analytics/AnalyticsRequestPropertiesMixin.js on lines 816..835

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

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

        withSortOrder(value) {
            const sortOrder = value.toUpperCase()

            const sortOrders = new Set(['ASC', 'DESC'])

Severity: Major
Found in src/analytics/AnalyticsRequestPropertiesMixin.js and 1 other location - About 4 hrs to fix
src/analytics/AnalyticsRequestPropertiesMixin.js on lines 329..344

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

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

        withDisplayProperty(value) {
            const displayProperty = value.toUpperCase()

            const displayProperties = new Set(['NAME', 'SHORTNAME'])

Severity: Major
Found in src/analytics/AnalyticsRequestPropertiesMixin.js and 1 other location - About 4 hrs to fix
src/analytics/AnalyticsRequestPropertiesMixin.js on lines 767..782

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

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('getQueryParamFormat for in multi value', () => {
            beforeEach(() => {
                filter.on('id').in(['1', '2', '3'])
            })

Severity: Major
Found in src/model/__tests__/Filter.spec.js and 1 other location - About 4 hrs to fix
src/model/__tests__/Filter.spec.js on lines 137..149

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

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('getQueryParamFormat for not in multi value', () => {
            beforeEach(() => {
                filter.on('id').notIn(['1', '2', '3'])
            })

Severity: Major
Found in src/model/__tests__/Filter.spec.js and 1 other location - About 4 hrs to fix
src/model/__tests__/Filter.spec.js on lines 123..135

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

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

Function init has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function init(initConfig, ApiClass = Api, logger = Logger.getLogger()) {
    const api = ApiClass.getApi()

    const config = Config.create(preInitConfig, initConfig)

Severity: Major
Found in src/d2.js - About 3 hrs to fix

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

        describe('getDataViewOrganisationUnits', () => {
            it('should return a promise', () => {
                expect(currentUser.getDataViewOrganisationUnits()).toBeInstanceOf(
                    Promise
                )
    Severity: Major
    Found in src/current-user/__tests__/CurrentUser.spec.js and 1 other location - About 3 hrs to fix
    src/current-user/__tests__/CurrentUser.spec.js on lines 187..201

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

    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('getOrganisationUnits', () => {
            it('should return a promise', () => {
                expect(currentUser.getOrganisationUnits()).toBeInstanceOf(Promise)
            })
    
    
    Severity: Major
    Found in src/current-user/__tests__/CurrentUser.spec.js and 1 other location - About 3 hrs to fix
    src/current-user/__tests__/CurrentUser.spec.js on lines 203..219

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

    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

    File AnalyticsRequestPropertiesMixin.js has 327 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint no-console: 0 */
    
    import AnalyticsRequest from './AnalyticsRequest'
    
    /**
    Severity: Minor
    Found in src/analytics/AnalyticsRequestPropertiesMixin.js - About 3 hrs to fix

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

              it('should generate 53 periods for common years starting on Thursday', () => {
                  // https://en.wikipedia.org/wiki/Common_year_starting_on_Thursday
                  expect(generateWeeklyPeriodsForYear(1705)).toHaveLength(53)
                  expect(generateWeeklyPeriodsForYear(2009)).toHaveLength(53)
                  expect(generateWeeklyPeriodsForYear(2015)).toHaveLength(53)
      Severity: Major
      Found in src/period/generators/__tests__/weekly.spec.js and 2 other locations - About 3 hrs to fix
      src/period/generators/__tests__/weekly.spec.js on lines 18..25
      src/period/generators/__tests__/weekly.spec.js on lines 27..34

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

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

              it('should generate 53 periods for leap years starting on Wednesday', () => {
                  // https://en.wikipedia.org/wiki/Leap_year_starting_on_Wednesday
                  expect(generateWeeklyPeriodsForYear(1936)).toHaveLength(53)
                  expect(generateWeeklyPeriodsForYear(1964)).toHaveLength(53)
                  expect(generateWeeklyPeriodsForYear(1992)).toHaveLength(53)
      Severity: Major
      Found in src/period/generators/__tests__/weekly.spec.js and 2 other locations - About 3 hrs to fix
      src/period/generators/__tests__/weekly.spec.js on lines 9..16
      src/period/generators/__tests__/weekly.spec.js on lines 18..25

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

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

              it('should generate 53 periods for leap years starting on Thursday', () => {
                  // https://en.wikipedia.org/wiki/Leap_year_starting_on_Thursday
                  expect(generateWeeklyPeriodsForYear(1948)).toHaveLength(53)
                  expect(generateWeeklyPeriodsForYear(1976)).toHaveLength(53)
                  expect(generateWeeklyPeriodsForYear(2004)).toHaveLength(53)
      Severity: Major
      Found in src/period/generators/__tests__/weekly.spec.js and 2 other locations - About 3 hrs to fix
      src/period/generators/__tests__/weekly.spec.js on lines 9..16
      src/period/generators/__tests__/weekly.spec.js on lines 27..34

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

      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

                      it('should set ordered to false when the ordered property is available and is false', () => {
                          const dataElementSchemaFixture = fixtures.get(
                              '/api/schemas/dataElement'
                          )
                          dataElementSchemaFixture.properties[0].ordered = false
      Severity: Major
      Found in src/model/__tests__/ModelDefinition.spec.js and 1 other location - About 3 hrs to fix
      src/model/__tests__/ModelDefinition.spec.js on lines 502..520

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

      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

                      it('should set ordered to true when the ordered property is available and is true', () => {
                          const dataElementSchemaFixture = fixtures.get(
                              '/api/schemas/dataElement'
                          )
                          dataElementSchemaFixture.properties[0].ordered = true
      Severity: Major
      Found in src/model/__tests__/ModelDefinition.spec.js and 1 other location - About 3 hrs to fix
      src/model/__tests__/ModelDefinition.spec.js on lines 484..500

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 109.

      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

              const formattedFilters = filters.map(({ dimension, items }) => {
                  if (Array.isArray(items) && items.length) {
                      if (options && options.sorted) {
                          items = sortBy(items)
                      }
      Severity: Major
      Found in src/analytics/AnalyticsRequestBase.js and 1 other location - About 3 hrs to fix
      src/analytics/AnalyticsRequestBase.js on lines 53..63

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

      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

              const formattedDimensions = dimensions.map(({ dimension, items }) => {
                  if (Array.isArray(items) && items.length) {
                      if (options && options.sorted) {
                          items = sortBy(items)
                      }
      Severity: Major
      Found in src/analytics/AnalyticsRequestBase.js and 1 other location - About 3 hrs to fix
      src/analytics/AnalyticsRequestBase.js on lines 94..104

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

      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('getUserRoles', () => {
              it('should return a promise', () => {
                  expect(currentUser.getUserRoles()).toBeInstanceOf(Promise)
              })
      
      
      Severity: Major
      Found in src/current-user/__tests__/CurrentUser.spec.js and 1 other location - About 3 hrs to fix
      src/current-user/__tests__/CurrentUser.spec.js on lines 155..170

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

      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