TheBrainFamily/chimpy

View on GitHub
src/__tests__/chimp-spec.js

Summary

Maintainability
F
5 days
Test Coverage

File chimp-spec.js has 642 lines of code (exceeds 250 allowed). Consider refactoring.
Open

jest.dontMock('../lib/chimp.js');
jest.dontMock('../lib/boolean-helper');
jest.dontMock('underscore');
jest.dontMock('async');
jest.dontMock('wrappy');
Severity: Major
Found in src/__tests__/chimp-spec.js - About 1 day to fix

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

        it('returns cucumber results when run handler is called successfully', () => {
          const Hapi = require('hapi');
          const Chimp = require('../lib/chimp.js');
          const chimp = new Chimp({serverHost: 'localhost', serverPort: 1234});
    
    
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 2 other locations - About 1 day to fix
    src/__tests__/chimp-spec.js on lines 457..473
    src/__tests__/chimp-spec.js on lines 475..491

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

    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('returns cucumber results when runAll handler is called successfully', () => {
          const Hapi = require('hapi');
          const Chimp = require('../lib/chimp.js');
          const chimp = new Chimp({serverHost: 'localhost', serverPort: 1234});
    
    
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 2 other locations - About 1 day to fix
    src/__tests__/chimp-spec.js on lines 417..434
    src/__tests__/chimp-spec.js on lines 457..473

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

    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('returns "done" when interrupt handler is called successfully', () => {
          const Hapi = require('hapi');
          const Chimp = require('../lib/chimp.js');
          const chimp = new Chimp({serverHost: 'localhost', serverPort: 1234});
    
    
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 2 other locations - About 1 day to fix
    src/__tests__/chimp-spec.js on lines 417..434
    src/__tests__/chimp-spec.js on lines 475..491

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

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

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

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

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

    Refactorings

    Further Reading

    Identical blocks of code found in 7 locations. Consider refactoring.
    Open

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 172..180
    src/__tests__/chimp-spec.js on lines 202..210
    src/__tests__/chimp-spec.js on lines 240..248
    src/__tests__/chimp-spec.js on lines 277..285
    src/__tests__/chimp-spec.js on lines 316..324
    src/__tests__/chimp-spec.js on lines 342..350

    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

    Identical blocks of code found in 7 locations. Consider refactoring.
    Open

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 147..155
    src/__tests__/chimp-spec.js on lines 172..180
    src/__tests__/chimp-spec.js on lines 240..248
    src/__tests__/chimp-spec.js on lines 277..285
    src/__tests__/chimp-spec.js on lines 316..324
    src/__tests__/chimp-spec.js on lines 342..350

    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

    Identical blocks of code found in 7 locations. Consider refactoring.
    Open

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 147..155
    src/__tests__/chimp-spec.js on lines 172..180
    src/__tests__/chimp-spec.js on lines 202..210
    src/__tests__/chimp-spec.js on lines 240..248
    src/__tests__/chimp-spec.js on lines 277..285
    src/__tests__/chimp-spec.js on lines 342..350

    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

    Identical blocks of code found in 7 locations. Consider refactoring.
    Open

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 147..155
    src/__tests__/chimp-spec.js on lines 172..180
    src/__tests__/chimp-spec.js on lines 202..210
    src/__tests__/chimp-spec.js on lines 240..248
    src/__tests__/chimp-spec.js on lines 316..324
    src/__tests__/chimp-spec.js on lines 342..350

    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

    Identical blocks of code found in 7 locations. Consider refactoring.
    Open

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 147..155
    src/__tests__/chimp-spec.js on lines 202..210
    src/__tests__/chimp-spec.js on lines 240..248
    src/__tests__/chimp-spec.js on lines 277..285
    src/__tests__/chimp-spec.js on lines 316..324
    src/__tests__/chimp-spec.js on lines 342..350

    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

    Identical blocks of code found in 7 locations. Consider refactoring.
    Open

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 147..155
    src/__tests__/chimp-spec.js on lines 172..180
    src/__tests__/chimp-spec.js on lines 202..210
    src/__tests__/chimp-spec.js on lines 277..285
    src/__tests__/chimp-spec.js on lines 316..324
    src/__tests__/chimp-spec.js on lines 342..350

    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

    Identical blocks of code found in 7 locations. Consider refactoring.
    Open

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 147..155
    src/__tests__/chimp-spec.js on lines 172..180
    src/__tests__/chimp-spec.js on lines 202..210
    src/__tests__/chimp-spec.js on lines 240..248
    src/__tests__/chimp-spec.js on lines 277..285
    src/__tests__/chimp-spec.js on lines 316..324

    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

    There are no issues that match your filters.

    Category
    Status