packages/miew/src/chem/Complex.js

Summary

Maintainability
F
1 wk
Test Coverage

File Complex.js has 755 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import logger from '../utils/logger'
import Atom from './Atom'
import Chain from './Chain'
import Helix from './Helix'
import Strand from './Strand'
Severity: Major
Found in packages/miew/src/chem/Complex.js - About 1 day to fix

    Complex has 65 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Complex {
      constructor() {
        this._chains = []
        this._components = []
        this._helices = []
    Severity: Major
    Found in packages/miew/src/chem/Complex.js - About 1 day to fix

      Function finalize has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

        finalize(opts) {
          opts = opts || {}
          // Put bonds into atoms
          const bonds = this._bonds
          let i
      Severity: Minor
      Found in packages/miew/src/chem/Complex.js - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function finalize has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        finalize(opts) {
          opts = opts || {}
          // Put bonds into atoms
          const bonds = this._bonds
          let i
      Severity: Major
      Found in packages/miew/src/chem/Complex.js - About 3 hrs to fix

        Function dssp has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          dssp() {
            const ssMap = new SecondaryStructureMap(this)
        
            const structures = (this.structures = [])
            const helices = (this._helices = [])
        Severity: Major
        Found in packages/miew/src/chem/Complex.js - About 2 hrs to fix

          Function dssp has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

            dssp() {
              const ssMap = new SecondaryStructureMap(this)
          
              const structures = (this.structures = [])
              const helices = (this._helices = [])
          Severity: Minor
          Found in packages/miew/src/chem/Complex.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function joinComplexes has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            joinComplexes(complexes) {
              // clear target complex
              this._chains = []
              this._components = []
              this._helices = []
          Severity: Major
          Found in packages/miew/src/chem/Complex.js - About 2 hrs to fix

            Function _fillCmpEdit has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _fillCmpEdit() {
                const self = this
                const components = this._components
            
                function addComp() {
            Severity: Minor
            Found in packages/miew/src/chem/Complex.js - About 1 hr to fix

              Function getAtomByFullname has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                getAtomByFullname(fullName) {
                  const parts = fullName.split('.')
                  if (parts.length !== 3) {
                    return null
                  }
              Severity: Minor
              Found in packages/miew/src/chem/Complex.js - About 1 hr to fix

                Function _fillCmpNoedit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  _fillCmpNoedit() {
                    const comp = new Component(this)
                    comp._index = 0
                
                    const residues = this._residues
                Severity: Minor
                Found in packages/miew/src/chem/Complex.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function joinComplexes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  joinComplexes(complexes) {
                    // clear target complex
                    this._chains = []
                    this._components = []
                    this._helices = []
                Severity: Minor
                Found in packages/miew/src/chem/Complex.js - About 25 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                  getElements() {
                    if (Object.hasOwn(this, '_elements')) {
                      return this._elements
                    }
                
                
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 1 other location - About 3 hrs to fix
                packages/miew/src/chem/Complex.js on lines 715..727

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

                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

                  getResidueNames() {
                    if (Object.hasOwn(this, '_residueNames')) {
                      return this._residueNames
                    }
                
                
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 1 other location - About 3 hrs to fix
                packages/miew/src/chem/Complex.js on lines 701..713

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

                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

                  getAtomNames() {
                    if (Object.hasOwn(this, '_atomNames')) {
                      return this._atomNames
                    }
                
                
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 1 other location - About 3 hrs to fix
                packages/miew/src/chem/Complex.js on lines 729..741

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

                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

                  getChainNames() {
                    if (Object.hasOwn(this, '_chainNames')) {
                      return this._chainNames
                    }
                
                
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 1 other location - About 3 hrs to fix
                packages/miew/src/chem/Complex.js on lines 687..699

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

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

                  forEachComponent(process) {
                    const components = this._components
                    for (let i = 0, n = components.length; i < n; ++i) {
                      process(components[i])
                    }
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 8 other locations - About 1 hr to fix
                packages/miew/src/chem/Chain.js on lines 177..182
                packages/miew/src/chem/Complex.js on lines 211..216
                packages/miew/src/chem/Complex.js on lines 218..223
                packages/miew/src/chem/Complex.js on lines 225..230
                packages/miew/src/chem/Complex.js on lines 232..237
                packages/miew/src/chem/Complex.js on lines 247..252
                packages/miew/src/chem/Complex.js on lines 261..266
                packages/miew/src/chem/Component.js on lines 96..101

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

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

                  forEachVisibleComponent(process) {
                    const components = this._components
                    for (let i = 0, n = components.length; i < n; ++i) {
                      process(components[i])
                    }
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 8 other locations - About 1 hr to fix
                packages/miew/src/chem/Chain.js on lines 177..182
                packages/miew/src/chem/Complex.js on lines 211..216
                packages/miew/src/chem/Complex.js on lines 218..223
                packages/miew/src/chem/Complex.js on lines 225..230
                packages/miew/src/chem/Complex.js on lines 232..237
                packages/miew/src/chem/Complex.js on lines 247..252
                packages/miew/src/chem/Complex.js on lines 254..259
                packages/miew/src/chem/Component.js on lines 96..101

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

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

                  forEachAtom(process) {
                    const atoms = this._atoms
                    for (let i = 0, n = atoms.length; i < n; ++i) {
                      process(atoms[i])
                    }
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 8 other locations - About 1 hr to fix
                packages/miew/src/chem/Chain.js on lines 177..182
                packages/miew/src/chem/Complex.js on lines 218..223
                packages/miew/src/chem/Complex.js on lines 225..230
                packages/miew/src/chem/Complex.js on lines 232..237
                packages/miew/src/chem/Complex.js on lines 247..252
                packages/miew/src/chem/Complex.js on lines 254..259
                packages/miew/src/chem/Complex.js on lines 261..266
                packages/miew/src/chem/Component.js on lines 96..101

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

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

                  forEachResidue(process) {
                    const residues = this._residues
                    for (let i = 0, n = residues.length; i < n; ++i) {
                      process(residues[i])
                    }
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 8 other locations - About 1 hr to fix
                packages/miew/src/chem/Chain.js on lines 177..182
                packages/miew/src/chem/Complex.js on lines 211..216
                packages/miew/src/chem/Complex.js on lines 218..223
                packages/miew/src/chem/Complex.js on lines 232..237
                packages/miew/src/chem/Complex.js on lines 247..252
                packages/miew/src/chem/Complex.js on lines 254..259
                packages/miew/src/chem/Complex.js on lines 261..266
                packages/miew/src/chem/Component.js on lines 96..101

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

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

                  forEachSGroup(process) {
                    const groups = this._sgroups
                    for (let i = 0, n = groups.length; i < n; ++i) {
                      process(groups[i])
                    }
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 8 other locations - About 1 hr to fix
                packages/miew/src/chem/Chain.js on lines 177..182
                packages/miew/src/chem/Complex.js on lines 211..216
                packages/miew/src/chem/Complex.js on lines 218..223
                packages/miew/src/chem/Complex.js on lines 225..230
                packages/miew/src/chem/Complex.js on lines 232..237
                packages/miew/src/chem/Complex.js on lines 254..259
                packages/miew/src/chem/Complex.js on lines 261..266
                packages/miew/src/chem/Component.js on lines 96..101

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

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

                  forEachBond(process) {
                    const bonds = this._bonds
                    for (let i = 0, n = bonds.length; i < n; ++i) {
                      process(bonds[i])
                    }
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 8 other locations - About 1 hr to fix
                packages/miew/src/chem/Chain.js on lines 177..182
                packages/miew/src/chem/Complex.js on lines 211..216
                packages/miew/src/chem/Complex.js on lines 225..230
                packages/miew/src/chem/Complex.js on lines 232..237
                packages/miew/src/chem/Complex.js on lines 247..252
                packages/miew/src/chem/Complex.js on lines 254..259
                packages/miew/src/chem/Complex.js on lines 261..266
                packages/miew/src/chem/Component.js on lines 96..101

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

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

                  forEachChain(process) {
                    const chains = this._chains
                    for (let i = 0, n = chains.length; i < n; ++i) {
                      process(chains[i])
                    }
                Severity: Major
                Found in packages/miew/src/chem/Complex.js and 8 other locations - About 1 hr to fix
                packages/miew/src/chem/Chain.js on lines 177..182
                packages/miew/src/chem/Complex.js on lines 211..216
                packages/miew/src/chem/Complex.js on lines 218..223
                packages/miew/src/chem/Complex.js on lines 225..230
                packages/miew/src/chem/Complex.js on lines 247..252
                packages/miew/src/chem/Complex.js on lines 254..259
                packages/miew/src/chem/Complex.js on lines 261..266
                packages/miew/src/chem/Component.js on lines 96..101

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

                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

                    for (i = 0, n = helices.length; i < n; ++i) {
                      helices[i]._finalize(opts.serialAtomMap, residueHash, this)
                    }
                Severity: Minor
                Found in packages/miew/src/chem/Complex.js and 1 other location - About 55 mins to fix
                packages/miew/src/chem/Complex.js on lines 528..530

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

                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

                    for (i = 0, n = structures.length; i < n; ++i) {
                      structures[i]._finalize(opts.serialAtomMap, residueHash, this)
                    }
                Severity: Minor
                Found in packages/miew/src/chem/Complex.js and 1 other location - About 55 mins to fix
                packages/miew/src/chem/Complex.js on lines 533..535

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

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

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

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

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

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status