Showing 711 of 1,553 total issues

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

  raycast(raycaster, intersects) {
    const ray = TransformGroup._ray
    const inverseMatrix = TransformGroup._inverseMatrix
    const { children } = this
    ray.copy(raycaster.ray)
Severity: Minor
Found in packages/miew/src/gfx/meshes/TransformGroup.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

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

  subDiv,
  residues,
  segmentsHeight,
  tension,
  mode,
Severity: Minor
Found in packages/miew/src/gfx/modes/groups/ResiduesSubseqGroup.js - About 45 mins to fix

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

      raycast(raycaster, intersects) {
        const { bonds } = this._selection
        const inters = []
        this._mesh.raycast(raycaster, inters)
        const bondsIdc = this._chunksIdc
    Severity: Minor
    Found in packages/miew/src/gfx/modes/groups/BondsGroup.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

    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/InstancedSpheresGeometry.js - About 45 mins to fix

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

        getResidueColor(residue, _complex) {
          const { opts } = this
          if (!opts) {
            return this.palette.defaultGradientColor
          }
      Severity: Minor
      Found in packages/miew/src/gfx/colorers/TemperatureColorer.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 (dx * dx + dy * dy + dz * dz <= rSum * rSum) {
                    out[outIdx++] = data[dataIndex]
                  }
      Severity: Major
      Found in packages/miew/src/gfx/geometries/ContactSurface.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if (!this.addTriangle(vaEdges[i0], vaEdges[i1], vaEdges[i2])) {
                      return 0 - 2
                    }
        Severity: Major
        Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if (gcVal[i] < isoValue) {
                        cubeIndex |= 1 << i
                      }
          Severity: Major
          Found in packages/miew/src/gfx/geometries/IsoSurface.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (this._voxelList[indVoxel] < 0) {
                          atomsList[numAtomsRefs * 2 + 0] = i
                          atomsList[numAtomsRefs * 2 + 1] = 0 - 1
                          this._voxelList[indVoxel] = numAtomsRefs
                          numAtomsRefs++
            Severity: Major
            Found in packages/miew/src/gfx/geometries/IsosurfaceBuildNormals.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          if (
                            this._visibilitySelector != null &&
                            density > atomWeightData[addr]
                          ) {
                            // NOSONAR
              Severity: Major
              Found in packages/miew/src/gfx/geometries/QuickSurfGeometry.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if (d2 < ar2) {
                              const w = Math.exp(-d2 * sigma2Inv)
                              const cIdx = idx * 3
                              volTex[cIdx] += cr * w
                              volTex[cIdx + 1] += cg * w
                Severity: Major
                Found in packages/miew/src/gfx/geometries/ContactSurface.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

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

                    function compareOptionsWithDefaults(opts, defOpts) {
                      const optsStr = []
                      if (defOpts && opts) {
                        const keys = Object.keys(opts)
                        for (let p = 0; p < keys.length; ++p) {
                    Severity: Minor
                    Found in packages/miew/src/utils.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 (i0 < 0) {
                                  break
                                }
                    Severity: Major
                    Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  for (let ix = minx; ix < maxx; ix++) {
                                    dx = px - gridx[ix]
                                    d2 = dzy2 + dx * dx
                                    const idx = ix + zyOffset
                                    const current = grid[idx]
                      Severity: Major
                      Found in packages/miew/src/gfx/geometries/ContactSurface.js - About 45 mins 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/Instanced2CCylindersGeometry.js - About 45 mins to fix

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

                            _innerBuild() {
                              let ok
                              const expandFactor = 1.2
                          
                              // performance test
                          Severity: Minor
                          Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.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 (type === BridgeType.NO_BRIDGE) {
                                        continue
                                      }
                          Severity: Major
                          Found in packages/miew/src/chem/SecondaryStructureMap.js - About 45 mins 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 buildSelectionGeometry has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                buildSelectionGeometry(mask) {
                                  let sg = null
                              
                                  if (this.geo && 'getSubset' in this.geo) {
                                    const meshes = this.geo.getSubset(mask)
                              Severity: Minor
                              Found in packages/miew/src/gfx/Representation.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

                              Severity
                              Category
                              Status
                              Source
                              Language