packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js

Summary

Maintainability
D
2 days
Test Coverage

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

  describe('.id', () => {
    const ssColorer = new SecondaryStructureColorer()

    it("have .id property type 'string'", () => {
      expect(ssColorer).to.have.property('id')
packages/miew/src/gfx/colorers/CarbonColorer.test.js on lines 46..58
packages/miew/src/gfx/colorers/ChainColorer.test.js on lines 67..79
packages/miew/src/gfx/colorers/ConformationColorer.test.js on lines 58..70
packages/miew/src/gfx/colorers/ElementColorer.test.js on lines 83..95
packages/miew/src/gfx/colorers/HydrophobicityColorer.test.js on lines 89..101
packages/miew/src/gfx/colorers/MoleuleColorer.test.js on lines 106..118
packages/miew/src/gfx/colorers/OccupancyColorer.test.js on lines 121..133
packages/miew/src/gfx/colorers/ResidueTypeColorer.test.js on lines 57..69
packages/miew/src/gfx/colorers/SequenceColorer.test.js on lines 116..128
packages/miew/src/gfx/colorers/UniformColorer.test.js on lines 21..33

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

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

  describe('.name', () => {
    it("have .name property type 'string'", () => {
      const ssColorer = new SecondaryStructureColorer()
      expect(ssColorer).to.have.property('name')
      expect(ssColorer.name).to.be.a('string')
packages/miew/src/gfx/colorers/CarbonColorer.test.js on lines 60..66
packages/miew/src/gfx/colorers/CarbonColorer.test.js on lines 68..74
packages/miew/src/gfx/colorers/ChainColorer.test.js on lines 81..87
packages/miew/src/gfx/colorers/ChainColorer.test.js on lines 89..95
packages/miew/src/gfx/colorers/ConformationColorer.test.js on lines 72..78
packages/miew/src/gfx/colorers/ConformationColorer.test.js on lines 80..86
packages/miew/src/gfx/colorers/ElementColorer.test.js on lines 97..103
packages/miew/src/gfx/colorers/ElementColorer.test.js on lines 105..111
packages/miew/src/gfx/colorers/HydrophobicityColorer.test.js on lines 103..109
packages/miew/src/gfx/colorers/HydrophobicityColorer.test.js on lines 111..117
packages/miew/src/gfx/colorers/MoleuleColorer.test.js on lines 120..126
packages/miew/src/gfx/colorers/MoleuleColorer.test.js on lines 128..134
packages/miew/src/gfx/colorers/OccupancyColorer.test.js on lines 135..141
packages/miew/src/gfx/colorers/OccupancyColorer.test.js on lines 143..149
packages/miew/src/gfx/colorers/ResidueTypeColorer.test.js on lines 71..77
packages/miew/src/gfx/colorers/ResidueTypeColorer.test.js on lines 79..85
packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js on lines 146..152
packages/miew/src/gfx/colorers/SequenceColorer.test.js on lines 130..136
packages/miew/src/gfx/colorers/SequenceColorer.test.js on lines 138..144
packages/miew/src/gfx/colorers/UniformColorer.test.js on lines 35..41
packages/miew/src/gfx/colorers/UniformColorer.test.js on lines 43..49

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

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

  describe('.shortName', () => {
    it("have .shortName property type 'string'", () => {
      const ssColorer = new SecondaryStructureColorer()
      expect(ssColorer).to.have.property('shortName')
      expect(ssColorer.shortName).to.be.a('string')
packages/miew/src/gfx/colorers/CarbonColorer.test.js on lines 60..66
packages/miew/src/gfx/colorers/CarbonColorer.test.js on lines 68..74
packages/miew/src/gfx/colorers/ChainColorer.test.js on lines 81..87
packages/miew/src/gfx/colorers/ChainColorer.test.js on lines 89..95
packages/miew/src/gfx/colorers/ConformationColorer.test.js on lines 72..78
packages/miew/src/gfx/colorers/ConformationColorer.test.js on lines 80..86
packages/miew/src/gfx/colorers/ElementColorer.test.js on lines 97..103
packages/miew/src/gfx/colorers/ElementColorer.test.js on lines 105..111
packages/miew/src/gfx/colorers/HydrophobicityColorer.test.js on lines 103..109
packages/miew/src/gfx/colorers/HydrophobicityColorer.test.js on lines 111..117
packages/miew/src/gfx/colorers/MoleuleColorer.test.js on lines 120..126
packages/miew/src/gfx/colorers/MoleuleColorer.test.js on lines 128..134
packages/miew/src/gfx/colorers/OccupancyColorer.test.js on lines 135..141
packages/miew/src/gfx/colorers/OccupancyColorer.test.js on lines 143..149
packages/miew/src/gfx/colorers/ResidueTypeColorer.test.js on lines 71..77
packages/miew/src/gfx/colorers/ResidueTypeColorer.test.js on lines 79..85
packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js on lines 138..144
packages/miew/src/gfx/colorers/SequenceColorer.test.js on lines 130..136
packages/miew/src/gfx/colorers/SequenceColorer.test.js on lines 138..144
packages/miew/src/gfx/colorers/UniformColorer.test.js on lines 35..41
packages/miew/src/gfx/colorers/UniformColorer.test.js on lines 43..49

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

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

    beforeEach(() => {
      paletteStub = sinon.stub(palettes, 'first').value(palette)
      residueTypeStub = sinon
        .stub(ResidueType, 'Flags')
        .value({ DNA: dnaFlag, RNA: rnaFlag })
packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js on lines 84..90

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

    beforeEach(() => {
      paletteStub = sinon.stub(palettes, 'first').value(palette)
      residueTypeStub = sinon
        .stub(ResidueType, 'Flags')
        .value({ DNA: dnaFlag, RNA: rnaFlag })
packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js on lines 60..66

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

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

    it('returns proper color for helix using generic information than residue is not DNA or RNA', () => {
      const residue = new Residue({ type: 'H', generic: 'helix' })
      expect(ssColorer.getResidueColor(residue)).to.equal(helixColor)
    })
packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js on lines 118..121

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

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('returns proper color for strand using type information than residue is not DNA or RNA', () => {
      const residue = new Residue({ type: 'E', generic: 'strand' })
      expect(ssColorer.getResidueColor(residue)).to.equal(eColor)
    })
packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js on lines 113..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 62.

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('returns proper color for RNA residue', () => {
      const residue = new Residue(null, rnaFlag)
      expect(ssColorer.getResidueColor(residue)).to.equal(rnaColor)
    })
packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js on lines 96..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 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

    it('returns proper color for DNA residue', () => {
      const residue = new Residue(null, dnaFlag)
      expect(ssColorer.getResidueColor(residue)).to.equal(dnaColor)
    })
packages/miew/src/gfx/colorers/SecondaryStructureColorer.test.js on lines 101..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 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

There are no issues that match your filters.

Category
Status