Showing 842 of 1,553 total issues

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

  describe('.shortName', () => {
    it("have .shortName property type 'string'", () => {
      const cColorer = new ChainColorer()
      expect(cColorer).to.have.property('shortName')
      expect(cColorer.shortName).to.be.a('string')
Severity: Major
Found in packages/miew/src/gfx/colorers/ChainColorer.test.js and 21 other locations - About 2 hrs to fix
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/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/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('.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('.name', () => {
    it("have .name property type 'string'", () => {
      const uColorer = new UniformColorer()
      expect(uColorer).to.have.property('name')
      expect(uColorer.name).to.be.a('string')
Severity: Major
Found in packages/miew/src/gfx/colorers/UniformColorer.test.js and 21 other locations - About 2 hrs to fix
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/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 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 4 locations. Consider refactoring.
Open

function dataUrlToBlob(url) {
  var parts = url.split(/[:;,]/);
  var partsCount = parts.length;
  if (partsCount >= 3 && parts[partsCount - 2] === 'base64') {
    return new Blob([bytesFromBase64(parts[partsCount - 1])]);
Severity: Major
Found in packages/miew-cli/dist/index.modern.js and 3 other locations - About 2 hrs to fix
packages/miew-cli/src/utils.js on lines 416..423
packages/miew/src/utils.js on lines 416..423
packages/miew-cli/dist/index.js on lines 3550..3557

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

function dataUrlToBlob(url) {
  const parts = url.split(/[:;,]/)
  const partsCount = parts.length
  if (partsCount >= 3 && parts[partsCount - 2] === 'base64') {
    return new Blob([bytesFromBase64(parts[partsCount - 1])])
Severity: Major
Found in packages/miew/src/utils.js and 3 other locations - About 2 hrs to fix
packages/miew-cli/src/utils.js on lines 416..423
packages/miew-cli/dist/index.js on lines 3550..3557
packages/miew-cli/dist/index.modern.js on lines 3546..3553

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 hColorer = new HydrophobicityColorer()
      expect(hColorer).to.have.property('shortName')
      expect(hColorer.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/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/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 sColorer = new SequenceColorer()
      expect(sColorer).to.have.property('shortName')
      expect(sColorer.shortName).to.be.a('string')
Severity: Major
Found in packages/miew/src/gfx/colorers/SequenceColorer.test.js and 21 other locations - About 2 hrs to fix
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/SecondaryStructureColorer.test.js on lines 146..152
packages/miew/src/gfx/colorers/SequenceColorer.test.js on lines 130..136
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

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

function dataUrlToBlob(url) {
  const parts = url.split(/[:;,]/)
  const partsCount = parts.length
  if (partsCount >= 3 && parts[partsCount - 2] === 'base64') {
    return new Blob([bytesFromBase64(parts[partsCount - 1])])
Severity: Major
Found in packages/miew-cli/src/utils.js and 3 other locations - About 2 hrs to fix
packages/miew/src/utils.js on lines 416..423
packages/miew-cli/dist/index.js on lines 3550..3557
packages/miew-cli/dist/index.modern.js on lines 3546..3553

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 mColorer = new MoleculeColorer()
      expect(mColorer).to.have.property('shortName')
      expect(mColorer.shortName).to.be.a('string')
Severity: Major
Found in packages/miew/src/gfx/colorers/MoleuleColorer.test.js and 21 other locations - About 2 hrs to fix
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/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/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('.name', () => {
    it("have .name property type 'string'", () => {
      const oColorer = new OccupancyColorer()
      expect(oColorer).to.have.property('name')
      expect(oColorer.name).to.be.a('string')
Severity: Major
Found in packages/miew/src/gfx/colorers/OccupancyColorer.test.js and 21 other locations - About 2 hrs to fix
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 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/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 3 locations. Consider refactoring.
Open

          createElement(
            'li',
            {
              class: 'list-group-item col-xs-12 col-sm-12',
              'data-toggle': 'combobox-panel',
Severity: Major
Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
demo/src/scripts/ui/Menu.js on lines 633..656
demo/src/scripts/ui/Menu.js on lines 658..681

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

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

function getUrlParametersAsDict(url) {
  const result = {}
  const a = getUrlParameters(url)
  for (let i = 0; i < a.length; ++i) {
    const [key, value] = a[i]
Severity: Major
Found in packages/miew/src/utils.js and 1 other location - About 2 hrs to fix
packages/miew-cli/src/utils.js on lines 81..89

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

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

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

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

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

Refactorings

Further Reading

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

          createElement(
            'li',
            {
              class: 'list-group-item col-xs-12 col-sm-12',
              'data-toggle': 'combobox-panel',
Severity: Major
Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
demo/src/scripts/ui/Menu.js on lines 633..656
demo/src/scripts/ui/Menu.js on lines 712..735

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

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

function getUrlParametersAsDict(url) {
  const result = {}
  const a = getUrlParameters(url)
  for (let i = 0; i < a.length; ++i) {
    const [key, value] = a[i]
Severity: Major
Found in packages/miew-cli/src/utils.js and 1 other location - About 2 hrs to fix
packages/miew/src/utils.js on lines 81..89

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

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

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

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

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

Refactorings

Further Reading

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

          createElement(
            'li',
            {
              class: 'list-group-item col-xs-12 col-sm-12',
              'data-toggle': 'combobox-panel',
Severity: Major
Found in demo/src/scripts/ui/Menu.js and 2 other locations - About 2 hrs to fix
demo/src/scripts/ui/Menu.js on lines 658..681
demo/src/scripts/ui/Menu.js on lines 712..735

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

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

var arrayWithHoles = createCommonjsModule(function (module) {
function _arrayWithHoles(arr) {
  if (Array.isArray(arr)) return arr;
}
module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
Severity: Major
Found in packages/miew-cli/dist/index.js and 1 other location - About 2 hrs to fix
packages/miew-cli/dist/index.modern.js on lines 3173..3178

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

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

var arrayWithHoles = createCommonjsModule(function (module) {
function _arrayWithHoles(arr) {
  if (Array.isArray(arr)) return arr;
}
module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
Severity: Major
Found in packages/miew-cli/dist/index.modern.js and 1 other location - About 2 hrs to fix
packages/miew-cli/dist/index.js on lines 3177..3182

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

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

function bytesToBase64(
buffer) {
  var bytes = new Uint8Array(buffer);
  var binary = '';
  for (var i = 0; i < bytes.byteLength; i++) {
Severity: Major
Found in packages/miew-cli/dist/index.js and 1 other location - About 2 hrs to fix
packages/miew-cli/dist/index.modern.js on lines 3438..3446

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

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

  collectMask() {
    let mask = 0xffffffff
    const residues = this._residues
    for (let i = 0, n = residues.length; i < n; ++i) {
      mask &= residues[i]._mask
Severity: Major
Found in packages/miew/src/chem/Chain.js and 1 other location - About 2 hrs to fix
packages/miew/src/chem/Residue.js on lines 158..165

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

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language