aurelia/aurelia

View on GitHub
packages/__tests__/src/store-v1/middleware.spec.ts

Summary

Maintainability
F
5 days
Test Coverage

File middleware.spec.ts has 579 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { skip, take } from "rxjs/operators";

import { assert } from '@aurelia/testing';
import {
  MiddlewarePlacement,
Severity: Major
Found in packages/__tests__/src/store-v1/middleware.spec.ts - About 1 day to fix

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

      it("should interrupt queue action if middleware returns sync false", async function () {
        const store = createStoreWithStateAndOptions(initialState, {});
        const { spyObj } = createCallCounter(store['_state'], "next");
        const syncFalseMiddleware = (): false => {
          return false;
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 4 hrs to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 390..402

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

    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

      it("should interrupt queue action if after placed middleware returns sync false", async function () {
        const store = createStoreWithStateAndOptions(initialState, {});
        const { spyObj } = createCallCounter(store['_state'], "next");
        const syncFalseMiddleware = (): false => {
          return false;
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 4 hrs to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 376..388

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

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

          store.state.pipe(
            skip(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 2);
            assert.greaterThanOrEqualTo(spyObj.callCounter, 1);
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 2 hrs to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 543..551

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

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

          store.state.pipe(
            skip(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 2);
            assert.greaterThanOrEqualTo(spyObj.callCounter, 1);
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 2 hrs to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 563..571

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

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

          await new Promise<void>((resolve) => {
            store.state.subscribe((state) => {
              assert.equal(state.counter, 1);
              resolve();
            });
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 2 hrs to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 203..208

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

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

          await new Promise<void>((resolve) => {
            store.state.subscribe((state) => {
              assert.equal(state.counter, 1);
              resolve();
            });
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 2 hrs to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 226..231

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

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

          mockLocalStorage({
            store: { foo: "bar" },
            getItem(key: string) {
              return this.store[key] || null;
            },
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 2 hrs to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 604..612

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

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

          mockLocalStorage({
            store: { foo: "bar" },
            getItem(key: string) {
              return this.store[key] || null;
            },
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 2 hrs to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 577..585

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

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

          store.state.pipe(
            skip(1),
            take(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 2);
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 282..288
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 306..312
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 330..336
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 461..467

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

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

          store.state.pipe(
            skip(1),
            take(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 1000);
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 256..262
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 306..312
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 330..336
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 461..467

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

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

          store.state.pipe(
            skip(1),
            take(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 1000);
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 256..262
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 282..288
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 330..336
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 461..467

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

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

          store.state.pipe(
            skip(1),
            take(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 1);
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 256..262
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 282..288
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 306..312
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 461..467

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

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

        store.state.pipe(
          skip(1),
          take(1)
        ).subscribe((state) => {
          assert.equal(state.counter, 14);
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 256..262
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 282..288
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 306..312
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 330..336

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

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

          store.state.pipe(
            skip(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 1);
            done();
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 644..649
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 669..674
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 686..691
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 752..757

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

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

          store.state.pipe(
            skip(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 1);
            done();
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 644..649
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 669..674
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 686..691
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 707..712

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

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

          store.state.pipe(
            skip(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 1000);
            done();
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 644..649
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 686..691
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 707..712
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 752..757

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

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

          store.state.pipe(
            skip(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 1);
            done();
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 644..649
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 669..674
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 707..712
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 752..757

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

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

          store.state.pipe(
            skip(1)
          ).subscribe((state) => {
            assert.equal(state.counter, 1000);
            done();
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 4 other locations - About 1 hr to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 669..674
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 686..691
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 707..712
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 752..757

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

    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

          const fixedValueAfter = async (currentState: TestState) => {
            const newState = { ...currentState };
            newState.counter = 1000;
    
            return Promise.resolve(newState);
    Severity: Minor
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 50 mins to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 214..219

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

    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

          const decreaseBefore = async (currentState: TestState) => {
            const newState = { ...currentState };
            newState.counter = 0;
    
            return Promise.resolve(newState);
    Severity: Minor
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 50 mins to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 294..299

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

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

          mockLocalStorage({
            getItem() {
              const storedState = { ...initialState };
              storedState.counter = 1000;
    
    
    Severity: Minor
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 40 mins to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 656..663

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

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

          mockLocalStorage({
            getItem() {
              const storedState = { ...initialState };
              storedState.counter = 1000;
    
    
    Severity: Minor
    Found in packages/__tests__/src/store-v1/middleware.spec.ts and 1 other location - About 40 mins to fix
    packages/__tests__/src/store-v1/middleware.spec.ts on lines 631..638

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

    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