packages/miew/src/chem/VoxelWorld.js

Summary

Maintainability
F
6 days
Test Coverage

File VoxelWorld.js has 296 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import utils from '../utils'
import { Vector2, Vector3 } from 'three'

/**
 * Calculate min & max radius of a sphere slice between zMin & zMax
Severity: Minor
Found in packages/miew/src/chem/VoxelWorld.js - About 3 hrs to fix

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

      _forEachVoxelWithinRadius(center, radius, process) {
        const xRange = VoxelWorld._xRange
        const yRange = VoxelWorld._yRange
        const zRange = VoxelWorld._zRange
    
    
    Severity: Major
    Found in packages/miew/src/chem/VoxelWorld.js - About 2 hrs to fix

      Function _forEachVoxelWithinRadiusSimple has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _forEachVoxelWithinRadiusSimple(center, radius, process) {
          const xRange = VoxelWorld._xRange
          const yRange = VoxelWorld._yRange
          const zRange = VoxelWorld._zRange
          const vCenter = VoxelWorld._vCenter
      Severity: Minor
      Found in packages/miew/src/chem/VoxelWorld.js - About 1 hr to fix

        Function _forEachAtomWithinDistFromGroup has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _forEachAtomWithinDistFromGroup(forEachAtom, dist, process) {
            const self = this
            const r2 = dist * dist
        
            const voxels = []
        Severity: Minor
        Found in packages/miew/src/chem/VoxelWorld.js - About 1 hr to fix

          Function _forEachAtomWithinDistFromGroup has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            _forEachAtomWithinDistFromGroup(forEachAtom, dist, process) {
              const self = this
              const r2 = dist * dist
          
              const voxels = []
          Severity: Minor
          Found in packages/miew/src/chem/VoxelWorld.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 _forEachVoxelWithinRadiusSimple has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            _forEachVoxelWithinRadiusSimple(center, radius, process) {
              const xRange = VoxelWorld._xRange
              const yRange = VoxelWorld._yRange
              const zRange = VoxelWorld._zRange
              const vCenter = VoxelWorld._vCenter
          Severity: Minor
          Found in packages/miew/src/chem/VoxelWorld.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 _forEachVoxelWithinRadius has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            _forEachVoxelWithinRadius(center, radius, process) {
              const xRange = VoxelWorld._xRange
              const yRange = VoxelWorld._yRange
              const zRange = VoxelWorld._zRange
          
          
          Severity: Minor
          Found in packages/miew/src/chem/VoxelWorld.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

          function _getCircleSliceRadiusRange(center, radius, yMin, yMax) {
            const dyMin = yMin - center.y
            const dyMax = yMax - center.y
            const ryMin = Math.sqrt(Math.max(radius * radius - dyMin * dyMin, 0.0))
            const ryMax = Math.sqrt(Math.max(radius * radius - dyMax * dyMax, 0.0))
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 1 other location - About 1 day to fix
          packages/miew/src/chem/VoxelWorld.js on lines 12..29

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

          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

          function _getSphereSliceRadiusRange(center, radius, zMin, zMax) {
            const dzMin = zMin - center.z
            const dzMax = zMax - center.z
            const rzMin = Math.sqrt(Math.max(radius * radius - dzMin * dzMin, 0.0))
            const rzMax = Math.sqrt(Math.max(radius * radius - dzMax * dzMax, 0.0))
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 1 other location - About 1 day to fix
          packages/miew/src/chem/VoxelWorld.js on lines 43..60

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

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

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

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

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

          Refactorings

          Further Reading

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

                  const yVal = [
                    this._box.min.y + y * this._cellSize.y,
                    this._box.min.y + (y + 1) * this._cellSize.y
                  ]
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 299..302
          packages/miew/src/chem/VoxelWorld.js on lines 313..316

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

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

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

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

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

          Refactorings

          Further Reading

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

                    xVal = [
                      this._box.min.x + x * this._cellSize.x,
                      this._box.min.x + (x + 1) * this._cellSize.x
                    ]
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 200..203
          packages/miew/src/chem/VoxelWorld.js on lines 217..220

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

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

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

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

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

          Refactorings

          Further Reading

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

                const zVal = [
                  this._box.min.z + z * this._cellSize.z,
                  this._box.min.z + (z + 1) * this._cellSize.z
                ]
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 306..309
          packages/miew/src/chem/VoxelWorld.js on lines 313..316

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

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

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

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

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

          Refactorings

          Further Reading

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

                zVal = [
                  this._box.min.z + z * this._cellSize.z,
                  this._box.min.z + (z + 1) * this._cellSize.z
                ]
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 217..220
          packages/miew/src/chem/VoxelWorld.js on lines 240..243

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

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

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

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

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

          Refactorings

          Further Reading

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

                    const xVal = [
                      this._box.min.x + x * this._cellSize.x,
                      this._box.min.x + (x + 1) * this._cellSize.x
                    ]
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 299..302
          packages/miew/src/chem/VoxelWorld.js on lines 306..309

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

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

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

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

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

          Refactorings

          Further Reading

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

                  yVal = [
                    this._box.min.y + y * this._cellSize.y,
                    this._box.min.y + (y + 1) * this._cellSize.y
                  ]
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 200..203
          packages/miew/src/chem/VoxelWorld.js on lines 240..243

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

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

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

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

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

          Refactorings

          Further Reading

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

              zRange
                .subScalar(this._box.min.z)
                .divideScalar(this._cellSize.z)
                .floor()
                .clampScalar(0, this._count.z - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 210..214
          packages/miew/src/chem/VoxelWorld.js on lines 233..237

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

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

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

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

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

          Refactorings

          Further Reading

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

                yRange
                  .subScalar(this._box.min.y)
                  .divideScalar(this._cellSize.y)
                  .floor()
                  .clampScalar(0, this._count.y - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 193..197
          packages/miew/src/chem/VoxelWorld.js on lines 233..237

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

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

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

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

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

          Refactorings

          Further Reading

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

                  xRange
                    .subScalar(this._box.min.x)
                    .divideScalar(this._cellSize.x)
                    .floor()
                    .clampScalar(0, this._count.x - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 1 hr to fix
          packages/miew/src/chem/VoxelWorld.js on lines 193..197
          packages/miew/src/chem/VoxelWorld.js on lines 210..214

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

          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

                    isInsideX =
                      center.x - rRangeX[0] <= xVal[0] && xVal[1] <= center.x + rRangeX[0]
          Severity: Minor
          Found in packages/miew/src/chem/VoxelWorld.js and 1 other location - About 50 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 222..223

          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

                  isInsideY =
                    center.y - rRangeXY[0] <= yVal[0] && yVal[1] <= center.y + rRangeXY[0]
          Severity: Minor
          Found in packages/miew/src/chem/VoxelWorld.js and 1 other location - About 50 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 244..245

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

              xRange.subScalar(this._box.min.x).divideScalar(this._cellSize.x).floor()
          Severity: Minor
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 35 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 289..289
          packages/miew/src/chem/VoxelWorld.js on lines 294..294

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

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

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

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

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

          Refactorings

          Further Reading

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

              zRange.subScalar(this._box.min.z).divideScalar(this._cellSize.z).floor()
          Severity: Minor
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 35 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 284..284
          packages/miew/src/chem/VoxelWorld.js on lines 289..289

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

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

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

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

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

          Refactorings

          Further Reading

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

              yRange.subScalar(this._box.min.y).divideScalar(this._cellSize.y).floor()
          Severity: Minor
          Found in packages/miew/src/chem/VoxelWorld.js and 2 other locations - About 35 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 284..284
          packages/miew/src/chem/VoxelWorld.js on lines 294..294

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

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

              zRange.x = Math.min(Math.max(zRange.x, 0), this._count.z - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 285..285
          packages/miew/src/chem/VoxelWorld.js on lines 286..286
          packages/miew/src/chem/VoxelWorld.js on lines 290..290
          packages/miew/src/chem/VoxelWorld.js on lines 291..291
          packages/miew/src/chem/VoxelWorld.js on lines 296..296

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

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

              xRange.x = Math.min(Math.max(xRange.x, 0), this._count.x - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 286..286
          packages/miew/src/chem/VoxelWorld.js on lines 290..290
          packages/miew/src/chem/VoxelWorld.js on lines 291..291
          packages/miew/src/chem/VoxelWorld.js on lines 295..295
          packages/miew/src/chem/VoxelWorld.js on lines 296..296

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

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

              xRange.y = Math.min(Math.max(xRange.y, 0), this._count.x - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 285..285
          packages/miew/src/chem/VoxelWorld.js on lines 290..290
          packages/miew/src/chem/VoxelWorld.js on lines 291..291
          packages/miew/src/chem/VoxelWorld.js on lines 295..295
          packages/miew/src/chem/VoxelWorld.js on lines 296..296

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

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

              yRange.y = Math.min(Math.max(yRange.y, 0), this._count.y - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 285..285
          packages/miew/src/chem/VoxelWorld.js on lines 286..286
          packages/miew/src/chem/VoxelWorld.js on lines 290..290
          packages/miew/src/chem/VoxelWorld.js on lines 295..295
          packages/miew/src/chem/VoxelWorld.js on lines 296..296

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

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

              zRange.y = Math.min(Math.max(zRange.y, 0), this._count.z - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 285..285
          packages/miew/src/chem/VoxelWorld.js on lines 286..286
          packages/miew/src/chem/VoxelWorld.js on lines 290..290
          packages/miew/src/chem/VoxelWorld.js on lines 291..291
          packages/miew/src/chem/VoxelWorld.js on lines 295..295

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

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

              yRange.x = Math.min(Math.max(yRange.x, 0), this._count.y - 1)
          Severity: Major
          Found in packages/miew/src/chem/VoxelWorld.js and 5 other locations - About 30 mins to fix
          packages/miew/src/chem/VoxelWorld.js on lines 285..285
          packages/miew/src/chem/VoxelWorld.js on lines 286..286
          packages/miew/src/chem/VoxelWorld.js on lines 291..291
          packages/miew/src/chem/VoxelWorld.js on lines 295..295
          packages/miew/src/chem/VoxelWorld.js on lines 296..296

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

          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