pedromsantos/glenn

View on GitHub
src/__test__/Domain/Song.test.ts

Summary

Maintainability
A
0 mins
Test Coverage

File Song.test.ts has 283 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

/* eslint-disable sonarjs/no-duplicate-string */
import { CompoundTimeSignature, Duration, SimpleTimeSignature } from '../../Domain/Duration';
import { Key } from '../../Domain/Key';
import { Note, Octave } from '../../Domain/Note';
import { Pitch } from '../../Domain/Pitch';
Severity: Minor
Found in src/__test__/Domain/Song.test.ts - About 2 hrs to fix

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

            measure
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C1))
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C2))
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C3))
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C4))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 1 day to fix
    src/__test__/Domain/Song.test.ts on lines 206..215

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

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

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

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

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

    Refactorings

    Further Reading

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

            measure
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C0))
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C1))
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C2))
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C3))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 1 day to fix
    src/__test__/Domain/Song.test.ts on lines 64..73

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('6 quarter notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C4))
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C5))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 7 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 138..148
    src/__test__/Domain/Song.test.ts on lines 272..282

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('6 eighth notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C6))
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C5))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 7 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 192..202
    src/__test__/Domain/Song.test.ts on lines 272..282

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('6 eighth notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C3))
              .add(new Note(Pitch.C, Duration.Eighth, Octave.C4))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 7 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 138..148
    src/__test__/Domain/Song.test.ts on lines 192..202

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('4 quarter notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C1))
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C2))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 5 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 50..60

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('2 dotted quarter notes and a quarter note fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C1))
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C2))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 5 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 38..48

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('4 dotted quarter notes notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C4))
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C3))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 4 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 128..136

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('2 dotted quarter notes and a quarter note fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C0))
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C1))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 4 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 182..190

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 132.

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

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

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

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

    Refactorings

    Further Reading

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

        test('cannot add dotted quarter to 2 quarter notes', () => {
          expect(() =>
            measure
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C4))
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C6))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 4 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 150..157

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

        test('cannot add dotted quarter to 2 quarter notes', () => {
          expect(() =>
            measure
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C1))
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C2))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 4 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 284..291

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

        test('3 quarter notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C4))
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C5))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 3 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 110..117
    src/__test__/Domain/Song.test.ts on lines 263..270

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('2 dotted quarter notes notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C0))
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C1))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 3 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 119..126
    src/__test__/Domain/Song.test.ts on lines 263..270

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('3 quarter notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C4))
              .add(new Note(Pitch.C, Duration.Quarter, Octave.C3))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 3 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 110..117
    src/__test__/Domain/Song.test.ts on lines 119..126

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('2 dotted quarter notes notes fill it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C0))
              .add(new Note(Pitch.C, Duration.DottedQuarter, Octave.C1))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 2 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 174..180

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

        test('2 dotted half note fills it', () => {
          expect(
            measure
              .add(new Note(Pitch.C, Duration.DottedHalf, Octave.C5))
              .add(new Note(Pitch.C, Duration.DottedHalf, Octave.C6))
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 1 other location - About 2 hrs to fix
    src/__test__/Domain/Song.test.ts on lines 255..261

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

        test('cannot fit double', () => {
          expect(() => measure.add(new Note(Pitch.C, Duration.Double, Octave.C4))).toThrow(
            `cannot fit -${Duration.Double.Name} note in measure`
          );
        });
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 3 other locations - About 1 hr to fix
    src/__test__/Domain/Song.test.ts on lines 98..102
    src/__test__/Domain/Song.test.ts on lines 168..172
    src/__test__/Domain/Song.test.ts on lines 243..247

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

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

        test('cannot fit double', () => {
          expect(() => measure.add(new Note(Pitch.C, Duration.Double, Octave.C4))).toThrow(
            `cannot fit -${Duration.Double.Name} note in measure`
          );
        });
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 3 other locations - About 1 hr to fix
    src/__test__/Domain/Song.test.ts on lines 17..21
    src/__test__/Domain/Song.test.ts on lines 98..102
    src/__test__/Domain/Song.test.ts on lines 243..247

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

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

        test('cannot fit whole', () => {
          expect(() => measure.add(new Note(Pitch.C, Duration.Whole, Octave.C4))).toThrow(
            `cannot fit -${Duration.Whole.Name} note in measure`
          );
        });
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 3 other locations - About 1 hr to fix
    src/__test__/Domain/Song.test.ts on lines 17..21
    src/__test__/Domain/Song.test.ts on lines 98..102
    src/__test__/Domain/Song.test.ts on lines 168..172

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

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

        test('cannot fit double', () => {
          expect(() => measure.add(new Note(Pitch.C, Duration.Double, Octave.C4))).toThrow(
            `cannot fit -${Duration.Double.Name} note in measure`
          );
        });
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 3 other locations - About 1 hr to fix
    src/__test__/Domain/Song.test.ts on lines 17..21
    src/__test__/Domain/Song.test.ts on lines 168..172
    src/__test__/Domain/Song.test.ts on lines 243..247

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('dotted half note fills it', () => {
          expect(measure.add(new Note(Pitch.C, Duration.DottedHalf, Octave.C4))).toBeInstanceOf(
            FullMeasure
          );
        });
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 55 mins to fix
    src/__test__/Domain/Song.test.ts on lines 23..25
    src/__test__/Domain/Song.test.ts on lines 249..253

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('whole note fills it', () => {
          expect(measure.add(new Note(Pitch.C, Duration.Whole, Octave.C4))).toBeInstanceOf(FullMeasure);
        });
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 55 mins to fix
    src/__test__/Domain/Song.test.ts on lines 104..108
    src/__test__/Domain/Song.test.ts on lines 249..253

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

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

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

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

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

    Refactorings

    Further Reading

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

        test('dotted half note fills it', () => {
          expect(measure.add(new Note(Pitch.C, Duration.DottedHalf, Octave.C4))).toBeInstanceOf(
            FullMeasure
          );
        });
    Severity: Major
    Found in src/__test__/Domain/Song.test.ts and 2 other locations - About 55 mins to fix
    src/__test__/Domain/Song.test.ts on lines 23..25
    src/__test__/Domain/Song.test.ts on lines 104..108

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

    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