huridocs/uwazi

View on GitHub
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js

Summary

Maintainability
A
0 mins
Test Coverage

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

  describe('OPEN_PANEL with referencePanel', () => {
    it('should set type to ViewerSaveReferenceMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, {
        type: ViewerTypes.OPEN_PANEL,
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 84..96
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 110..122

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

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 with targetReferencePanel', () => {
    it('should set type to ViewerSaveTargetReferenceMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, {
        type: ViewerTypes.OPEN_PANEL,
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 84..96
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 97..109

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

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 with viewMetadataPanel', () => {
    it('should set type to ViewMetadataMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, {
        type: ViewerTypes.OPEN_PANEL,
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 97..109
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 110..122

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

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

  describe('ENTER_UPLOADS_SECTION', () => {
    it('should set type to UploadsMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, {
        type: UploadActions.ENTER_UPLOADS_SECTION,
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 39..48
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 50..59
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 61..70
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 72..83
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 136..145

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

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

  describe('LOAD_DEFAULT_VIEWER_MENU', () => {
    it('should set type to ViewerDefaultMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, {
        type: ViewerTypes.LOAD_DEFAULT_VIEWER_MENU,
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 39..48
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 50..59
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 61..70
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 123..134
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 136..145

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

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

  describe('ADD_REFERENCE', () => {
    it('should set type to ViewerDefaultMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, { type: ViewerTypes.ADD_REFERENCE });
      const expected = Immutable.fromJS({ type: 'ViewerDefaultMenu' });
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 39..48
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 50..59
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 72..83
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 123..134
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 136..145

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

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

  describe('UNSET_SELECTION', () => {
    it('should set type to ViewerDefaultMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, { type: ViewerTypes.UNSET_SELECTION });
      const expected = Immutable.fromJS({ type: 'ViewerDefaultMenu' });
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 39..48
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 61..70
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 72..83
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 123..134
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 136..145

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

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('OPEN_MENU', () => {
    it('should set open = true', () => {
      const currentState = Immutable.fromJS({ open: false });
      const newState = contextMenuReducer(currentState, { type: types.OPEN_MENU });
      const expected = Immutable.fromJS({ open: true });
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 28..37

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

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

  describe('SET_SELECTION', () => {
    it('should set type to ViewerTextSelectedMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, { type: ViewerTypes.SET_SELECTION });
      const expected = Immutable.fromJS({ type: 'ViewerTextSelectedMenu' });
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 50..59
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 61..70
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 72..83
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 123..134
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 136..145

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

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

  describe('ENTER_LIBRARY', () => {
    it('should set type to LibraryMenu', () => {
      const currentState = Immutable.fromJS({ type: null });
      const newState = contextMenuReducer(currentState, { type: LibraryActions.ENTER_LIBRARY });
      const expected = Immutable.fromJS({ type: 'LibraryMenu' });
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 39..48
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 50..59
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 61..70
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 72..83
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 123..134

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

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('CLOSE_MENU', () => {
    it('should set open = false', () => {
      const currentState = Immutable.fromJS({ open: true });
      const newState = contextMenuReducer(currentState, { type: types.CLOSE_MENU });
      const expected = Immutable.fromJS({ open: false });
app/react/ContextMenu/reducers/specs/contextMenuReducer.spec.js on lines 17..26

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

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