Showing 1,553 of 1,553 total issues

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

  _setSlopeNormals(ptsCount, ringsCount, chunkStartIdx) {
    const normals = this._normals
    const nPtsInRing = ptsCount * VEC_SIZE

    let vtxIdx = chunkStartIdx
Severity: Minor
Found in packages/miew/src/gfx/geometries/ExtrudedObjectsGeometry.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  getSubset(mask, innerOnly) {
    const totalSubset = []
    const { children } = this
    let meshIdx = 0
    for (let i = 0, n = children.length; i < n; ++i) {
Severity: Minor
Found in packages/miew/src/gfx/modes/processors/SubseqsProcessor.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

function propagateColor(color, rule) {
  let result
  if (Object.hasOwn(colorMappings, rule)) {
    result = utils.hexColor(colorMappings[rule](color))
  } else {
Severity: Minor
Found in packages/miew/src/gfx/modes/groups/AtomsTextGroup.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  getSubset(mask, innerOnly) {
    const totalSubset = []
    const { children } = this
    let meshIdx = 0
    for (let i = 0, n = children.length; i < n; ++i) {
Severity: Minor
Found in packages/miew/src/gfx/modes/processors/AtomsProcessor.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  _addExistingPairs() {
    const atoms = this._complex.getAtoms()
    const numAtoms = atoms.length
    let aInd = 0
    const collection = this._pairCollection
Severity: Minor
Found in packages/miew/src/chem/AutoBond.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  _haveSameCycle(bondsData, bond1, bond2) {
    const arr1 = bondsData[bond1._index]
    const arr2 = bondsData[bond2._index]
    const n1 = arr1.length
    const n2 = arr2.length
Severity: Minor
Found in packages/miew/src/chem/AromaticLoopsMarker.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  enable(gfx) {
    if (!gfx) {
      logger.warn("WebVR couldn't be enabled, because gfx is not defined")
      return
    }
Severity: Minor
Found in packages/miew/src/gfx/vr/WebVRPoC.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  getCylinderTargetList() {
    const type = this._type._name
    for (let i = 0, n = cCylinderTarget.length; i < n; ++i) {
      for (let j = 0, m = cCylinderTarget[i].types.length; j < m; ++j) {
        if (type === cCylinderTarget[i].types[j]) {
Severity: Minor
Found in packages/miew/src/chem/Residue.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  _addPair(atomA, atomB) {
    const bondsA = atomA.bonds
    const indexA = atomA.index
    const indexB = atomB.index
    for (let j = 0, numBonds = bondsA.length; j < numBonds; ++j) {
Severity: Minor
Found in packages/miew/src/chem/AutoBond.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

Raycaster.prototype.intersectVisibleObject = function (
  gfxObj,
  camera,
  clipPlane,
  fogFarPlane
Severity: Minor
Found in packages/miew/src/gfx/gfxutils.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  _finalize() {
    const self = this
    ;[this._firstAtom] = this._atoms
    this._lastAtom = this._atoms[this._atoms.length - 1]

Severity: Minor
Found in packages/miew/src/chem/Residue.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

function setSubArray(src, dst, count, copyFunctor, functorOpts) {
  if (
    (dst.array.length - dst.start) / dst.stride < count ||
    (src.array.length - src.start) / src.stride < count
  ) {
Severity: Minor
Found in packages/miew/src/io/exporters/fbx/FBXModel.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  addResidue(name, sequence, iCode) {
    let type = this._complex.getResidueType(name)
    if (type === null) {
      type = this._complex.addResidueType(name)
    }
Severity: Minor
Found in packages/miew/src/chem/Chain.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  _toXYZData() {
    const header = this._header
    const byteBuffer = new Uint8Array(this._buff)
    const xyzData = new Float32Array(
      header.extent[0] * header.extent[1] * header.extent[2]
Severity: Minor
Found in packages/miew/src/io/parsers/DSN6Parser.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  _toXYZData() {
    const header = this._header
    const data = this._data
    const xyz2crs = this._xyz2crs
    const xyzData = new Float32Array(data.length)
Severity: Minor
Found in packages/miew/src/io/parsers/CCP4Parser.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

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

Cognitive Complexity

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

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

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

Further reading

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

  find(specs) {
    let list = []
    if (specs.format) {
      list = this._dict.formats[specs.format.toLowerCase()] || []
    } else if (specs.ext) {
Severity: Minor
Found in packages/miew/src/io/parsers/ParserList.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

Logger.prototype._message = function (priority, message) {
  if (priority < this._priority) {
    return
  }
  const level = findKey(priorities, (value) => value === priority)
Severity: Minor
Found in packages/miew/src/utils/logger.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  next() {
    const start = this._next + 1
    this._start = start < this._end ? start : this._end

    // support CR, LF, CR+LF line endings
Severity: Minor
Found in packages/miew/src/io/parsers/PDBStream.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

  writeBondsArray(bonds, atom) {
    const bondsArrays = this._getSubArrays(bonds, 4)

    for (let k = 0; k < bondsArrays.length; k++) {
      this.newString()
Severity: Minor
Found in packages/miew/src/io/exporters/PDBResult.js - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

Severity
Category
Status
Source
Language