cucumber/cucumber-js

View on GitHub

Showing 225 of 225 total issues

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

    describe('skipped', () => {
      beforeEach(function() {
        this.eventBroadcaster.emit('test-step-finished', {
          index: 0,
          result: { status: Status.SKIPPED },
Severity: Major
Found in src/formatter/progress_formatter_spec.js and 5 other locations - About 3 hrs to fix
src/formatter/progress_formatter_spec.js on lines 34..46
src/formatter/progress_formatter_spec.js on lines 48..60
src/formatter/progress_formatter_spec.js on lines 62..74
src/formatter/progress_formatter_spec.js on lines 76..88
src/formatter/progress_formatter_spec.js on lines 104..116

Duplicated Code

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

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

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

Tuning

This issue has a mass of 107.

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

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

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

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

Refactorings

Further Reading

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

    describe('failed', () => {
      beforeEach(function() {
        this.eventBroadcaster.emit('test-step-finished', {
          index: 0,
          result: { status: Status.FAILED },
Severity: Major
Found in src/formatter/progress_formatter_spec.js and 5 other locations - About 3 hrs to fix
src/formatter/progress_formatter_spec.js on lines 34..46
src/formatter/progress_formatter_spec.js on lines 62..74
src/formatter/progress_formatter_spec.js on lines 76..88
src/formatter/progress_formatter_spec.js on lines 90..102
src/formatter/progress_formatter_spec.js on lines 104..116

Duplicated Code

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

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

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

Tuning

This issue has a mass of 107.

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

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

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

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

Refactorings

Further Reading

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

    describe('passed', () => {
      beforeEach(function() {
        this.eventBroadcaster.emit('test-step-finished', {
          index: 0,
          result: { status: Status.PASSED },
Severity: Major
Found in src/formatter/progress_formatter_spec.js and 5 other locations - About 3 hrs to fix
src/formatter/progress_formatter_spec.js on lines 34..46
src/formatter/progress_formatter_spec.js on lines 48..60
src/formatter/progress_formatter_spec.js on lines 76..88
src/formatter/progress_formatter_spec.js on lines 90..102
src/formatter/progress_formatter_spec.js on lines 104..116

Duplicated Code

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

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

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

Tuning

This issue has a mass of 107.

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

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

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

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

Refactorings

Further Reading

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

    describe('undefined', () => {
      beforeEach(function() {
        this.eventBroadcaster.emit('test-step-finished', {
          index: 0,
          result: { status: Status.UNDEFINED },
Severity: Major
Found in src/formatter/progress_formatter_spec.js and 5 other locations - About 3 hrs to fix
src/formatter/progress_formatter_spec.js on lines 34..46
src/formatter/progress_formatter_spec.js on lines 48..60
src/formatter/progress_formatter_spec.js on lines 62..74
src/formatter/progress_formatter_spec.js on lines 76..88
src/formatter/progress_formatter_spec.js on lines 90..102

Duplicated Code

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

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

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

Tuning

This issue has a mass of 107.

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

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

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

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

Refactorings

Further Reading

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

    describe('pending', () => {
      beforeEach(function() {
        this.eventBroadcaster.emit('test-step-finished', {
          index: 0,
          result: { status: Status.PENDING },
Severity: Major
Found in src/formatter/progress_formatter_spec.js and 5 other locations - About 3 hrs to fix
src/formatter/progress_formatter_spec.js on lines 34..46
src/formatter/progress_formatter_spec.js on lines 48..60
src/formatter/progress_formatter_spec.js on lines 62..74
src/formatter/progress_formatter_spec.js on lines 90..102
src/formatter/progress_formatter_spec.js on lines 104..116

Duplicated Code

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

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

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

Tuning

This issue has a mass of 107.

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

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

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

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

Refactorings

Further Reading

File pickle_filter_spec.js has 316 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { beforeEach, describe, it } from 'mocha'
import { expect } from 'chai'
import PickleFilter from './pickle_filter'

describe('PickleFilter', () => {
Severity: Minor
Found in src/pickle_filter_spec.js - About 3 hrs to fix

    Function parse has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static parse(argv) {
        const program = new Command(path.basename(argv[1]))
    
        program
          .usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')
    Severity: Major
    Found in src/cli/argv_parser.js - About 3 hrs to fix

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

            it('emits a source event', function() {
              expect(this.onSource).to.have.callCount(1)
              expect(this.onSource).to.have.been.calledWith({
                data: 'Feature: a\nScenario: b\nGiven a step',
                media: { encoding: 'utf-8', type: 'text/x.cucumber.gherkin+plain' },
      Severity: Major
      Found in src/cli/helpers_spec.js and 2 other locations - About 3 hrs to fix
      src/cli/helpers_spec.js on lines 46..53
      src/cli/helpers_spec.js on lines 132..139

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

      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('emits a source event', function() {
              expect(this.onSource).to.have.callCount(1)
              expect(this.onSource).to.have.been.calledWith({
                data: 'Feature: a\nScenario: b\nGiven a step',
                media: { encoding: 'utf-8', type: 'text/x.cucumber.gherkin+plain' },
      Severity: Major
      Found in src/cli/helpers_spec.js and 2 other locations - About 3 hrs to fix
      src/cli/helpers_spec.js on lines 46..53
      src/cli/helpers_spec.js on lines 92..99

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

      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('emits a source event', function() {
              expect(this.onSource).to.have.callCount(1)
              expect(this.onSource).to.have.been.calledWith({
                data: '',
                media: { encoding: 'utf-8', type: 'text/x.cucumber.gherkin+plain' },
      Severity: Major
      Found in src/cli/helpers_spec.js and 2 other locations - About 3 hrs to fix
      src/cli/helpers_spec.js on lines 92..99
      src/cli/helpers_spec.js on lines 132..139

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

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

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

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

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

      Refactorings

      Further Reading

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

          describe('keyword is But, previous keyword type is outcome', () => {
            beforeEach(function() {
              this.keywordType = getStepKeywordType({
                keyword: 'But ',
                language: 'en',
      Severity: Major
      Found in src/formatter/helpers/keyword_type_spec.js and 1 other location - About 3 hrs to fix
      src/formatter/helpers/keyword_type_spec.js on lines 65..77

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

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

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

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

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

      Refactorings

      Further Reading

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

          describe('keyword is And, previous keyword type is event', () => {
            beforeEach(function() {
              this.keywordType = getStepKeywordType({
                keyword: 'And ',
                language: 'en',
      Severity: Major
      Found in src/formatter/helpers/keyword_type_spec.js and 1 other location - About 3 hrs to fix
      src/formatter/helpers/keyword_type_spec.js on lines 92..104

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 100.

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

            it('emits test-step-started', function() {
              expect(this.onTestStepStarted).to.have.callCount(1)
              expect(this.onTestStepStarted).to.have.been.calledWith({
                index: 0,
                testCase: { sourceLocation: { line: 1, uri: 'path/to/feature' } },
      Severity: Major
      Found in src/runtime/test_case_runner_spec.js and 4 other locations - About 3 hrs to fix
      src/runtime/test_case_runner_spec.js on lines 125..131
      src/runtime/test_case_runner_spec.js on lines 197..203
      src/runtime/test_case_runner_spec.js on lines 346..352
      src/runtime/test_case_runner_spec.js on lines 411..417

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

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

            it('emits test-step-started', function() {
              expect(this.onTestStepStarted).to.have.callCount(1)
              expect(this.onTestStepStarted).to.have.been.calledWith({
                index: 0,
                testCase: { sourceLocation: { line: 1, uri: 'path/to/feature' } },
      Severity: Major
      Found in src/runtime/test_case_runner_spec.js and 4 other locations - About 3 hrs to fix
      src/runtime/test_case_runner_spec.js on lines 125..131
      src/runtime/test_case_runner_spec.js on lines 197..203
      src/runtime/test_case_runner_spec.js on lines 279..285
      src/runtime/test_case_runner_spec.js on lines 346..352

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

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

            it('emits test-step-started', function() {
              expect(this.onTestStepStarted).to.have.callCount(1)
              expect(this.onTestStepStarted).to.have.been.calledWith({
                index: 0,
                testCase: { sourceLocation: { line: 1, uri: 'path/to/feature' } },
      Severity: Major
      Found in src/runtime/test_case_runner_spec.js and 4 other locations - About 3 hrs to fix
      src/runtime/test_case_runner_spec.js on lines 125..131
      src/runtime/test_case_runner_spec.js on lines 279..285
      src/runtime/test_case_runner_spec.js on lines 346..352
      src/runtime/test_case_runner_spec.js on lines 411..417

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

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

            it('emits test-step-started', function() {
              expect(this.onTestStepStarted).to.have.callCount(1)
              expect(this.onTestStepStarted).to.have.been.calledWith({
                index: 0,
                testCase: { sourceLocation: { line: 1, uri: 'path/to/feature' } },
      Severity: Major
      Found in src/runtime/test_case_runner_spec.js and 4 other locations - About 3 hrs to fix
      src/runtime/test_case_runner_spec.js on lines 125..131
      src/runtime/test_case_runner_spec.js on lines 197..203
      src/runtime/test_case_runner_spec.js on lines 279..285
      src/runtime/test_case_runner_spec.js on lines 411..417

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

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

            it('emits test-step-started', function() {
              expect(this.onTestStepStarted).to.have.callCount(1)
              expect(this.onTestStepStarted).to.have.been.calledWith({
                index: 0,
                testCase: { sourceLocation: { line: 1, uri: 'path/to/feature' } },
      Severity: Major
      Found in src/runtime/test_case_runner_spec.js and 4 other locations - About 3 hrs to fix
      src/runtime/test_case_runner_spec.js on lines 197..203
      src/runtime/test_case_runner_spec.js on lines 279..285
      src/runtime/test_case_runner_spec.js on lines 346..352
      src/runtime/test_case_runner_spec.js on lines 411..417

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

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

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

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

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

      Refactorings

      Further Reading

      File progress_bar_formatter_spec.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { beforeEach, describe, it } from 'mocha'
      import { expect } from 'chai'
      import { createMock } from './test_helpers'
      import sinon from 'sinon'
      import getColorFns from './get_color_fns'
      Severity: Minor
      Found in src/formatter/progress_bar_formatter_spec.js - About 3 hrs to fix

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

              describe('with a duration of 120.3 seconds', () => {
                beforeEach(function() {
                  this.eventBroadcaster.emit('test-run-finished', {
                    result: { duration: 123 * 1000 },
                  })
        Severity: Major
        Found in src/formatter/summary_formatter_spec.js and 1 other location - About 2 hrs to fix
        src/formatter/summary_formatter_spec.js on lines 229..239

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

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

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

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

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

        Refactorings

        Further Reading

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

              describe('with a duration of 12.3 seconds', () => {
                beforeEach(function() {
                  this.eventBroadcaster.emit('test-run-finished', {
                    result: { duration: 123 * 100 },
                  })
        Severity: Major
        Found in src/formatter/summary_formatter_spec.js and 1 other location - About 2 hrs to fix
        src/formatter/summary_formatter_spec.js on lines 241..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 93.

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

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

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

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

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language