packages/miew/src/chem/SecondaryStructureMap.js

Summary

Maintainability
F
1 wk
Test Coverage

Function _buildBetaSheets has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
Open

  _buildBetaSheets() {
    // find bridges
    // check each chain against each other chain, and against itself
    const bridges = []
    for (let a = 0; a < this._complex._chains.length; ++a) {
Severity: Minor
Found in packages/miew/src/chem/SecondaryStructureMap.js - About 2 days 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 _buildAlphaHelices has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
Open

  _buildAlphaHelices(inResidues, chainLength, inPreferPiHelices) {
    // Helix and Turn
    for (let stride = 3; stride <= 5; ++stride) {
      if (inResidues.length < stride) {
        break
Severity: Minor
Found in packages/miew/src/chem/SecondaryStructureMap.js - About 1 day 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 _buildBetaSheets has 209 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _buildBetaSheets() {
    // find bridges
    // check each chain against each other chain, and against itself
    const bridges = []
    for (let a = 0; a < this._complex._chains.length; ++a) {
Severity: Major
Found in packages/miew/src/chem/SecondaryStructureMap.js - About 1 day to fix

    File SecondaryStructureMap.js has 462 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import HBondInfo from './HBondInfo'
    import ResidueType from './ResidueType'
    
    const BridgeType = Object.freeze({
      NO_BRIDGE: 0,
    Severity: Minor
    Found in packages/miew/src/chem/SecondaryStructureMap.js - About 7 hrs to fix

      Function _buildAlphaHelices has 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _buildAlphaHelices(inResidues, chainLength, inPreferPiHelices) {
          // Helix and Turn
          for (let stride = 3; stride <= 5; ++stride) {
            if (inResidues.length < stride) {
              break
      Severity: Major
      Found in packages/miew/src/chem/SecondaryStructureMap.js - About 4 hrs to fix

        Function _build has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _build() {
            const self = this
            this._hbonds = new HBondInfo(this._complex)
            this._ss = [] // DSSP map by residue
        
        
        Severity: Minor
        Found in packages/miew/src/chem/SecondaryStructureMap.js - About 1 hr to fix

          Function _build has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            _build() {
              const self = this
              this._hbonds = new HBondInfo(this._complex)
              this._ss = [] // DSSP map by residue
          
          
          Severity: Minor
          Found in packages/miew/src/chem/SecondaryStructureMap.js - About 45 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

          Avoid deeply nested control flow statements.
          Open

                      if (
                        typeof this._helixFlags[stride][inResidues[j]._index] ===
                        'undefined'
                      ) {
                        this._helixFlags[stride][inResidues[j]._index] = HelixFlag.MIDDLE
          Severity: Major
          Found in packages/miew/src/chem/SecondaryStructureMap.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        for (const bridge of bridges) {
                          if (
                            type !== bridge.type ||
                            ri._index !== bridge.i[bridge.i.length - 1] + 1
                          ) {
            Severity: Major
            Found in packages/miew/src/chem/SecondaryStructureMap.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          if (type === BridgeType.NO_BRIDGE) {
                            continue
                          }
              Severity: Major
              Found in packages/miew/src/chem/SecondaryStructureMap.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if (!found) {
                              bridges.push({
                                type,
                                i: [ri._index],
                                chainI: ri.getChain()._index,
                Severity: Major
                Found in packages/miew/src/chem/SecondaryStructureMap.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if (this._areBridgesLinked(a, b)) {
                                toMove.add(b)
                              }
                  Severity: Major
                  Found in packages/miew/src/chem/SecondaryStructureMap.js - About 45 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (
                              bridges[i].type !== bridges[j].type ||
                              this._hasChainBreak(Math.min(ibi, ibj), Math.max(iei, iej)) ||
                              this._hasChainBreak(Math.min(jbi, jbj), Math.max(jei, jej)) ||
                              ibj - iei >= 6 ||
                    Severity: Major
                    Found in packages/miew/src/chem/SecondaryStructureMap.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                            if (
                              this._isHelixStart(inResidues[i]._index, 5) &&
                              this._isHelixStart(inResidues[i - 1]._index, 5)
                            ) {
                              let empty = true
                      Severity: Major
                      Found in packages/miew/src/chem/SecondaryStructureMap.js - About 40 mins to fix

                        Function _testBridge has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _testBridge(chainA, from, chainB, to) {
                            let result = BridgeType.NO_BRIDGE
                        
                            const a = chainA[from - 1]._index
                            const b = chainA[from]._index
                        Severity: Minor
                        Found in packages/miew/src/chem/SecondaryStructureMap.js - About 35 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

                        Function _areBridgesLinked has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _areBridgesLinked(a, b) {
                            const ai = new Set(a.i)
                            const aj = new Set(a.j)
                        
                            for (const i of b.i) {
                        Severity: Minor
                        Found in packages/miew/src/chem/SecondaryStructureMap.js - About 35 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

                              for (let k = bridge.i[0]; k <= bridge.i[bridge.i.length - 1]; ++k) {
                                if (this._ss[k] !== StructureType.STRAND) {
                                  this._ss[k] = ss
                                  this._sheet[k] = bridge.sheet
                                }
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 3 hrs to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 481..486

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

                        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 (let k = bridge.j[0]; k <= bridge.j[bridge.j.length - 1]; ++k) {
                                if (this._ss[k] !== StructureType.STRAND) {
                                  this._ss[k] = ss
                                  this._sheet[k] = bridge.sheet
                                }
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 3 hrs to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 474..479

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

                        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

                          _residueGetCAlpha(res) {
                            for (let i = 0; i < res._atoms.length; ++i) {
                              const { name } = res._atoms[i]
                              if (name === 'CA' || name === 'C1') {
                                return res._atoms[i].position
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 3 hrs to fix
                        packages/miew/src/chem/HBondInfo.js on lines 150..159

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

                        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

                                for (let k = 0; k < bridge.i.length; ++k) {
                                  this._betaPartners[bridge.i[k]][betai] = {
                                    residue: bridge.j[j++],
                                    ladder: bridge.ladder,
                                    parallel: true
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 3 other locations - About 2 hrs to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 447..453
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 456..462
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 465..471

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

                        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

                                for (let k = 0; k < bridge.i.length; ++k) {
                                  this._betaPartners[bridge.i[k]][betai] = {
                                    residue: bridge.j[j--],
                                    ladder: bridge.ladder,
                                    parallel: false
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 3 other locations - About 2 hrs to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 438..444
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 447..453
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 465..471

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

                        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

                                for (let k = 0; k < bridge.j.length; ++k) {
                                  this._betaPartners[bridge.j[k]][betaj] = {
                                    residue: bridge.i[j--],
                                    ladder: bridge.ladder,
                                    parallel: false
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 3 other locations - About 2 hrs to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 438..444
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 447..453
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 456..462

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

                        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

                                for (let k = 0; k < bridge.j.length; ++k) {
                                  this._betaPartners[bridge.j[k]][betaj] = {
                                    residue: bridge.i[j++],
                                    ladder: bridge.ladder,
                                    parallel: true
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 3 other locations - About 2 hrs to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 438..444
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 456..462
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 465..471

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

                        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 (let l = 0; l < bridge.j.length; ++l) {
                                if (this._betaPartners[bridge.j[l]][0]) {
                                  betaj = 1
                                  break
                                }
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 1 hr to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 417..422

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

                        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 (let l = 0; l < bridge.i.length; ++l) {
                                if (this._betaPartners[bridge.i[l]][0]) {
                                  betai = 1
                                  break
                                }
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 1 hr to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 424..429

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

                        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

                                if (empty) {
                                  for (let j = i; j <= i + 2; ++j) {
                                    this._ss[inResidues[j]._index] = StructureType.HELIX_310
                                  }
                                }
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 1 hr to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 165..169

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

                        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

                                if (empty) {
                                  for (let j = i; j <= i + 4; ++j) {
                                    this._ss[inResidues[j]._index] = StructureType.HELIX_PI
                                  }
                                }
                        Severity: Major
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 1 hr to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 144..148

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

                        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

                                    typeof this._ss[inResidues[j]._index] === 'undefined' ||
                                    this._ss[inResidues[j]._index] === StructureType.HELIX_310
                        Severity: Minor
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 50 mins to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 160..161

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

                        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

                                    typeof this._ss[inResidues[j]._index] === 'undefined' ||
                                    this._ss[inResidues[j]._index] === StructureType.HELIX_PI ||
                        Severity: Minor
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 50 mins to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 141..142

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

                        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

                                      if (
                                        type === BridgeType.PARALLEL &&
                                        bridge.j[bridge.j.length - 1] + 1 === rj._index
                                      ) {
                                        bridge.i.push(ri._index)
                        Severity: Minor
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 45 mins to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 293..301

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

                        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

                                      if (
                                        type === BridgeType.ANTI_PARALLEL &&
                                        bridge.j[0] - 1 === rj._index
                                      ) {
                                        bridge.i.push(ri._index)
                        Severity: Minor
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 45 mins to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 283..291

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 50.

                        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 (const i of b.i) {
                              if (ai.has(i) || aj.has(i)) {
                                return true
                              }
                            }
                        Severity: Minor
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 35 mins to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 523..527

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

                        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 (const i of b.j) {
                              if (ai.has(i) || aj.has(i)) {
                                return true
                              }
                            }
                        Severity: Minor
                        Found in packages/miew/src/chem/SecondaryStructureMap.js and 1 other location - About 35 mins to fix
                        packages/miew/src/chem/SecondaryStructureMap.js on lines 517..521

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

                        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