huridocs/uwazi

View on GitHub
app/react/Viewer/reducers/specs/uiReducer.spec.js

Summary

Maintainability
A
0 mins
Test Coverage

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

  describe('SET_SELECTION', () => {
    it('should set sourceRange passed', () => {
      const newState = uiReducer(Immutable.fromJS({}), {
        type: types.SET_SELECTION,
        sourceRange: 'sourceRange',
Severity: Major
Found in app/react/Viewer/reducers/specs/uiReducer.spec.js and 1 other location - About 2 hrs to fix
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 187..200

Duplicated Code

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

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

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

Tuning

This issue has a mass of 128.

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

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

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

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

Refactorings

Further Reading

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

  describe('SET_TARGET_SELECTION', () => {
    it('should set targetRange and targetFile passed', () => {
      const newState = uiReducer(Immutable.fromJS({}), {
        type: types.SET_TARGET_SELECTION,
        targetRange: 'targetRange',
Severity: Major
Found in app/react/Viewer/reducers/specs/uiReducer.spec.js and 1 other location - About 2 hrs to fix
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 142..155

Duplicated Code

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

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

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

Tuning

This issue has a mass of 128.

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

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

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

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

Refactorings

Further Reading

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

    it('should set targetRange and targetFile to null', () => {
      const newState = uiReducer(Immutable.fromJS({ reference: { targetRange: 'targetRange' } }), {
        type: types.UNSET_TARGET_SELECTION,
      });
      const expected = Immutable.fromJS({ reference: { targetRange: null, targetFile: null } });
Severity: Major
Found in app/react/Viewer/reducers/specs/uiReducer.spec.js and 1 other location - About 1 hr to fix
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 158..165

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

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

    it('should set sourceRange and sourceFile to null', () => {
      const newState = uiReducer(Immutable.fromJS({ reference: { sourceRange: 'sourceRange' } }), {
        type: types.UNSET_SELECTION,
      });
      const expected = Immutable.fromJS({ reference: { sourceRange: null, sourceFile: null } });
Severity: Major
Found in app/react/Viewer/reducers/specs/uiReducer.spec.js and 1 other location - About 1 hr to fix
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 203..210

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

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

  describe('HIGHLIGHT_REFERENCE', () => {
    it('should set highlightedReference to reference id passed', () => {
      const newState = uiReducer(Immutable.fromJS({}), {
        type: types.HIGHLIGHT_REFERENCE,
        reference: 'reference',
Severity: Major
Found in app/react/Viewer/reducers/specs/uiReducer.spec.js and 2 other locations - About 1 hr to fix
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 49..59
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 248..258

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

  describe('ACTIVE_REFERENCE', () => {
    it('should set highlightedReference to reference id passed', () => {
      const newState = uiReducer(Immutable.fromJS({}), {
        type: types.ACTIVE_REFERENCE,
        reference: 'reference',
Severity: Major
Found in app/react/Viewer/reducers/specs/uiReducer.spec.js and 2 other locations - About 1 hr to fix
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 49..59
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 225..235

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

  describe('OPEN_PANEL', () => {
    it('should set panel = to the panel passed', () => {
      const newState = uiReducer(Immutable.fromJS({}), {
        type: types.OPEN_PANEL,
        panel: 'a panel',
Severity: Major
Found in app/react/Viewer/reducers/specs/uiReducer.spec.js and 2 other locations - About 1 hr to fix
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 225..235
app/react/Viewer/reducers/specs/uiReducer.spec.js on lines 248..258

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

Definition for rule 'node/no-restricted-import' was not found.
Open

import Immutable from 'immutable';

For more information visit Source: http://eslint.org/docs/rules/

There are no issues that match your filters.

Category
Status