Showing 711 of 1,553 total issues

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 compare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  compare(candidate) {
    const len = candidate.length
    if (len !== this._original.length) {
      return false
    }
Severity: Minor
Found in packages/miew/src/io/parsers/MMTFParser.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 _tweakResolution has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _tweakResolution() {
    const maxPerf = [
      ['poor', 100],
      ['low', 500],
      ['medium', 1000],
Severity: Minor
Found in packages/miew/src/Miew.ts - 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 _initGfx has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _initGfx() {
    const gfx = {
      width: this._container.clientWidth,
      height: this._container.clientHeight
    }
Severity: Minor
Found in packages/miew/src/Miew.ts - 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 _onGroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _onGroup(groupData) {
    if (groupData.modelIndex !== 0) {
      return
    }

Severity: Minor
Found in packages/miew/src/io/parsers/MMTFParser.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 _export has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _export(format) {
    const TheExporter = head(io.exporters.find({ format }))
    if (!TheExporter) {
      this.logger.error('Could not find suitable exporter for this source')
      return Promise.reject(
Severity: Minor
Found in packages/miew/src/Miew.ts - 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 _getOperations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function _getOperations(operList) {
  if (!operList) {
    return null
  }
  const idc = arrize(operList.id)
Severity: Minor
Found in packages/miew/src/io/parsers/CIFParser.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 _renderFrame has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _renderFrame(stereo) {
    const gfx = this._gfx
    const { renderer } = gfx

    renderer.getSize(this._size)
Severity: Minor
Found in packages/miew/src/Miew.ts - 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 hash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  version.hash = (function () {
    function stdout(cmd) {
      return cmd.stdout === null ? 'nogit' : String(cmd.stdout).trim()
    }

Severity: Minor
Found in packages/miew/tools/version.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 _fillHeader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _fillHeader(headerFormat, arrays) {
    for (const key in headerFormat) {
      if (Object.hasOwn(headerFormat, key)) {
        switch (headerFormat[key][0]) {
          case valueType.singular:
Severity: Minor
Found in packages/miew/src/io/parsers/VolumeModel.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 addObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  addObject(objData, bThrow) {
    let Ctor = null

    if (objData.type === LinesObject.prototype.type) {
      Ctor = LinesObject
Severity: Minor
Found in packages/miew/src/Miew.ts - 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