Showing 1,553 of 1,553 total issues

File Instanced2CCylindersGeometry.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Color,
  InstancedBufferAttribute,
  InstancedBufferGeometry,
  Matrix4,
Severity: Minor
Found in packages/miew/src/gfx/geometries/Instanced2CCylindersGeometry.js - About 2 hrs to fix

    Function projectTorus has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function projectTorus(a, b) {
        const aIdx = itemSize * a
        const bIdx = itemSize * b
        const xa = posRad[aIdx]
        const ya = posRad[aIdx + 1]
    Severity: Major
    Found in packages/miew/src/gfx/geometries/ContactSurface.js - About 2 hrs to fix

      Function exportCML has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        exportCML() {
          const self = this
      
          function extractRotation(m) {
            const xAxis = new Vector3()
      Severity: Major
      Found in packages/miew/src/Miew.ts - About 2 hrs to fix

        File IsosurfaceBuildNormals.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import utils from '../../utils'
        import { Vector3 } from 'three'
        
        // suppress some JSHint warnings
        /* jshint bitwise: false */
        Severity: Minor
        Found in packages/miew/src/gfx/geometries/IsosurfaceBuildNormals.js - About 2 hrs to fix

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

            describe('.name', () => {
              it("have .name property type 'string'", () => {
                const cColorer = new ChainColorer()
                expect(cColorer).to.have.property('name')
                expect(cColorer.name).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 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 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 2 locations. Consider refactoring.
          Open

            disableSubset(mask, innerOnly) {
              const { children } = this
              for (let i = 0, n = children.length; i < n; ++i) {
                if (children[i].disableSubset) {
                  children[i].disableSubset(mask, innerOnly)
          Severity: Major
          Found in packages/miew/src/gfx/RCGroup.js and 1 other location - About 2 hrs to fix
          packages/miew/src/gfx/RCGroup.js on lines 15..22

          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 eColorer = new ElementColorer()
                expect(eColorer).to.have.property('shortName')
                expect(eColorer.shortName).to.be.a('string')
          Severity: Major
          Found in packages/miew/src/gfx/colorers/ElementColorer.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/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 2 locations. Consider refactoring.
          Open

            ).on('click', () => {
              let activeItem
              if (type === 'miew-menu-panel-palette') {
                activeItem = settings.get(path)
              } else {
          Severity: Major
          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 2 hrs to fix
          demo/src/scripts/ui/Menu.js on lines 350..358

          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 cColorer = new CarbonColorer()
                expect(cColorer).to.have.property('name')
                expect(cColorer.name).to.be.a('string')
          Severity: Major
          Found in packages/miew/src/gfx/colorers/CarbonColorer.test.js and 21 other locations - About 2 hrs to fix
          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 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 rtColorer = new ResidueTypeColorer()
                expect(rtColorer).to.have.property('shortName')
                expect(rtColorer.shortName).to.be.a('string')
          Severity: Major
          Found in packages/miew/src/gfx/colorers/ResidueTypeColorer.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/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 cColorer = new ConformationColorer()
                expect(cColorer).to.have.property('shortName')
                expect(cColorer.shortName).to.be.a('string')
          Severity: Major
          Found in packages/miew/src/gfx/colorers/ConformationColorer.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/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 hColorer = new HydrophobicityColorer()
                expect(hColorer).to.have.property('name')
                expect(hColorer.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 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 sColorer = new SequenceColorer()
                expect(sColorer).to.have.property('name')
                expect(sColorer.name).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 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) {
            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.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.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 2 locations. Consider refactoring.
          Open

              /** @this HTMLSelectElement */ () => {
                let activeItem
                if (type === 'miew-menu-panel-palette') {
                  activeItem = settings.get(path)
                } else {
          Severity: Major
          Found in demo/src/scripts/ui/Menu.js and 1 other location - About 2 hrs to fix
          demo/src/scripts/ui/Menu.js on lines 363..371

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

            enableSubset(mask, innerOnly) {
              const { children } = this
              for (let i = 0, n = children.length; i < n; ++i) {
                if (children[i].enableSubset) {
                  children[i].enableSubset(mask, innerOnly)
          Severity: Major
          Found in packages/miew/src/gfx/RCGroup.js and 1 other location - About 2 hrs to fix
          packages/miew/src/gfx/RCGroup.js on lines 24..31

          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 oColorer = new OccupancyColorer()
                expect(oColorer).to.have.property('shortName')
                expect(oColorer.shortName).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 135..141
          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 eColorer = new ElementColorer()
                expect(eColorer).to.have.property('name')
                expect(eColorer.name).to.be.a('string')
          Severity: Major
          Found in packages/miew/src/gfx/colorers/ElementColorer.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 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 mColorer = new MoleculeColorer()
                expect(mColorer).to.have.property('name')
                expect(mColorer.name).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 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 rtColorer = new ResidueTypeColorer()
                expect(rtColorer).to.have.property('name')
                expect(rtColorer.name).to.be.a('string')
          Severity: Major
          Found in packages/miew/src/gfx/colorers/ResidueTypeColorer.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 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

          Severity
          Category
          Status
          Source
          Language