__tests__/actions/snippetsActions.spec.js

Summary

Maintainability
F
4 days
Test Coverage

File snippetsActions.spec.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as AT from 'constants/actionTypes';
import * as snippetsActions from 'actions/snippets';

const files = {
  'hi.txt': {
Severity: Minor
Found in __tests__/actions/snippetsActions.spec.js - About 2 hrs to fix

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

      test('createSnippet (public) action should be created', () => {
        expect(snippetsActions.createSnippet({
          description: 'hello',
          files,
          isPublic: true
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 1 other location - About 3 hrs to fix
    __tests__/actions/snippetsActions.spec.js on lines 116..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 104.

    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

      test('createSnippet (private) action should be created', () => {
        expect(snippetsActions.createSnippet({
          description: 'hello',
          files,
          isPublic: false
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 1 other location - About 3 hrs to fix
    __tests__/actions/snippetsActions.spec.js on lines 136..154

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

    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

      test('updateTempSnippet action should be created', () => {
        expect(snippetsActions.updateTempSnippet('snippet.name', 'name here')).toEqual({
          meta: {
            path: 'snippet.name',
            value: 'name here'
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 2 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 276..288
    __tests__/actions/snippetsActions.spec.js on lines 290..302

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

    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

    test('deleteComment action should be created', () => {
      expect(snippetsActions.deleteComment('123123', '234234')).toEqual({
        meta: {
          id: '123123',
          commentId: '234234'
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 2 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 192..204
    __tests__/actions/snippetsActions.spec.js on lines 276..288

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

    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

    test('createSnippetComment action should be created', () => {
      expect(snippetsActions.createSnippetComment('123123', 'hi')).toEqual({
        meta: {
          id: '123123',
          body: 'hi'
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 2 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 192..204
    __tests__/actions/snippetsActions.spec.js on lines 290..302

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

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

      test('filterSnippetsByStatus action should be created', () => {
        expect(snippetsActions.filterSnippetsByStatus('private')).toEqual({
          meta: {
            status: 'private'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('filterSnippetsByLanguage action should be created', () => {
        expect(snippetsActions.filterSnippetsByLanguage('HTML')).toEqual({
          meta: {
            value: 'HTML'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('getSnippet action should be created', () => {
        expect(snippetsActions.getSnippet('id123id123')).toEqual({
          meta: {
            id: 'id123id123'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('filterSnippetsByTags action should be created', () => {
        expect(snippetsActions.filterSnippetsByTags('#tag')).toEqual({
          meta: {
            value: '#tag'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('editSnippet action should be created', () => {
        expect(snippetsActions.editSnippet('id123id123')).toEqual({
          meta: {
            id: 'id123id123'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('deleteTempFile action should be created', () => {
        expect(snippetsActions.deleteTempFile('id123id123')).toEqual({
          meta: {
            uuid: 'id123id123'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('starSnippet action should be created', () => {
        expect(snippetsActions.starSnippet('id123id123')).toEqual({
          meta: {
            id: 'id123id123'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('unStarSnippet action should be created', () => {
        expect(snippetsActions.unStarSnippet('id123id123')).toEqual({
          meta: {
            id: 'id123id123'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('removeTagFromFilter action should be created', () => {
        expect(snippetsActions.removeTagFromFilter('#tag2')).toEqual({
          meta: {
            tag: '#tag2'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('filterSnippetsByText action should be created', () => {
        expect(snippetsActions.filterSnippetsByText('some text')).toEqual({
          meta: {
            value: 'some text'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

      test('deleteSnippet action should be created', () => {
        expect(snippetsActions.deleteSnippet('id123id123')).toEqual({
          meta: {
            id: 'id123id123'
          },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190
    __tests__/actions/snippetsActions.spec.js on lines 264..274

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

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

    test('getSnippetComments action should be created', () => {
      expect(snippetsActions.getSnippetComments('123123')).toEqual({
        meta: {
          id: '123123'
        },
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 11 other locations - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 24..32
    __tests__/actions/snippetsActions.spec.js on lines 34..42
    __tests__/actions/snippetsActions.spec.js on lines 44..52
    __tests__/actions/snippetsActions.spec.js on lines 54..62
    __tests__/actions/snippetsActions.spec.js on lines 64..72
    __tests__/actions/snippetsActions.spec.js on lines 86..94
    __tests__/actions/snippetsActions.spec.js on lines 96..104
    __tests__/actions/snippetsActions.spec.js on lines 106..114
    __tests__/actions/snippetsActions.spec.js on lines 156..164
    __tests__/actions/snippetsActions.spec.js on lines 166..174
    __tests__/actions/snippetsActions.spec.js on lines 182..190

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

    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

    test('filterSnippetsByStatus action should be created', () => {
      expect(snippetsActions.toggleCollapse('123123', 'file.txt')).toEqual({
        type: AT.TOGGLE_FILE_COLLAPSE,
        payload: {
          snippetId: '123123',
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 1 other location - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 244..251

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

    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

      test('addTempFile action should be created', () => {
        expect(snippetsActions.addTempFile('a', 'b')).toEqual({
          type: AT.ADD_TEMP_FILE,
          payload: {
            fileContent: "b",
    Severity: Major
    Found in __tests__/actions/snippetsActions.spec.js and 1 other location - About 1 hr to fix
    __tests__/actions/snippetsActions.spec.js on lines 254..262

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

    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

      test('getSnippets action should be created', () => {
        expect(snippetsActions.getSnippets()).toEqual({ type: AT.GET_SNIPPETS, payload: { since: undefined  } });
      });
    Severity: Minor
    Found in __tests__/actions/snippetsActions.spec.js and 1 other location - About 50 mins to fix
    __tests__/actions/snippetsActions.spec.js on lines 20..22

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

    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

      test('getStarredSnippets action should be created', () => {
        expect(snippetsActions.getStarredSnippets()).toEqual({ type: AT.GET_STARRED_SNIPPETS, payload: { since: undefined  } });
      });
    Severity: Minor
    Found in __tests__/actions/snippetsActions.spec.js and 1 other location - About 50 mins to fix
    __tests__/actions/snippetsActions.spec.js on lines 16..18

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

    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

    There are no issues that match your filters.

    Category
    Status