packages/miew/src/gfx/geometries/ThickLinesGeometry.js

Summary

Maintainability
C
1 day
Test Coverage

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

  _initVertices(segmentsCount) {
    this._buffersSize = segmentsCount * VERTEX_PER_SEGMENT
    const pointsCount = this._buffersSize
    const use32bitIndex = pointsCount > MAX_IDC_16BIT
    this._index = utils.allocateTyped(
Severity: Minor
Found in packages/miew/src/gfx/geometries/ThickLinesGeometry.js - About 1 hr to fix

    Function setArrayXYZW has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function setArrayXYZW(arr, idx, x, y, z, w) {
    Severity: Minor
    Found in packages/miew/src/gfx/geometries/ThickLinesGeometry.js - About 45 mins to fix

      Function setArrayXYZ has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function setArrayXYZ(arr, idx, x, y, z) {
      Severity: Minor
      Found in packages/miew/src/gfx/geometries/ThickLinesGeometry.js - About 35 mins to fix

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

        function setArrayXYZW(arr, idx, x, y, z, w) {
          arr[idx] = x
          arr[idx + 1] = y
          arr[idx + 2] = z
          arr[idx + 3] = w
        Severity: Major
        Found in packages/miew/src/gfx/geometries/ThickLinesGeometry.js and 2 other locations - About 1 hr to fix
        packages/miew/src/gfx/geometries/Instanced2CCylindersGeometry.js on lines 27..32
        packages/miew/src/gfx/geometries/InstancedSpheresGeometry.js on lines 24..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 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

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

          setOpacity(startSegIdx, endSegIdx, value) {
            const start = startSegIdx * VERTEX_PER_SEGMENT
            const end = endSegIdx * VERTEX_PER_SEGMENT
            fill(this.alpha, value, end, start)
            this.getAttribute('alphaColor').needsUpdate = true
        Severity: Major
        Found in packages/miew/src/gfx/geometries/ThickLinesGeometry.js and 1 other location - About 1 hr to fix
        packages/miew/src/gfx/geometries/ThinLinesGeometry.js on lines 62..67

        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

        function getSubset(arr, startSegmentIdx, segmentsCount, elemSize) {
          const start = startSegmentIdx * VERTEX_PER_SEGMENT
          const end = start + segmentsCount * VERTEX_PER_SEGMENT
          return arr.subarray(start * elemSize, end * elemSize)
        }
        Severity: Major
        Found in packages/miew/src/gfx/geometries/ThickLinesGeometry.js and 1 other location - About 1 hr to fix
        packages/miew/src/gfx/geometries/ThinLinesGeometry.js on lines 16..20

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

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

        function setArrayXYZ(arr, idx, x, y, z) {
          arr[idx] = x
          arr[idx + 1] = y
          arr[idx + 2] = z
        }
        Severity: Major
        Found in packages/miew/src/gfx/geometries/ThickLinesGeometry.js and 3 other locations - About 55 mins to fix
        packages/miew/src/gfx/geometries/Instanced2CCylindersGeometry.js on lines 21..25
        packages/miew/src/gfx/geometries/InstancedSpheresGeometry.js on lines 18..22
        packages/miew/src/gfx/geometries/ThinLinesGeometry.js on lines 10..14

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

        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