Showing 711 of 1,553 total issues

Function deriveDeep has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function deriveDeep(obj, needZeroOwnProperties) {
  let res = obj
  let i
  let n
  if (obj instanceof Array) {
Severity: Minor
Found in packages/miew-cli/src/utils.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 _build has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  _build() {
    const bondsIdc = this._selection.chunks
    const { bonds, parent } = this._selection
    const mode = this._mode
    const colorer = this._colorer
Severity: Minor
Found in packages/miew/src/gfx/modes/groups/BondsLinesGroup.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 deriveDeep has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function deriveDeep(obj, needZeroOwnProperties) {
  let res = obj
  let i
  let n
  if (obj instanceof Array) {
Severity: Minor
Found in packages/miew/src/utils.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 vertexFusion has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  vertexFusion(offset, len) {
    const faceVer = this._indices.length
    const vertices = this._position
    const normals = this._normals
    const oldVerCount = vertices.length | 0
Severity: Minor
Found in packages/miew/src/gfx/geometries/IsoSurface.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 screenshot has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  screenshot(width, height) {
    const gfx = this._gfx
    const deviceWidth = gfx.renderer.domElement.width
    const deviceHeight = gfx.renderer.domElement.height

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

  _extractConfs(complex, helicesData) {
    const { asymDict } = this
    if (
      !helicesData.conf_type_id ||
      !helicesData.beg_label_seq_id ||
Severity: Minor
Found in packages/miew/src/io/parsers/CIFParser.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 constructor has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(
    AromaticGroup,
    geoParams,
    complex,
    colorer,
Severity: Minor
Found in packages/miew/src/gfx/modes/processors/AromaticProcessor.js - About 1 hr to fix

    Function getNumIntersectedCells has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getNumIntersectedCells(side, numCells, corners, cube) {
        const side2 = side * side
        const cNumVerts = 8
        let numIntersectedCells = 0
    
    
    Severity: Minor
    Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 1 hr to fix

      Function _prepareAxesAndDirs has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _prepareAxesAndDirs() {
          const volData = this._volumetricData
      
          const cellSize = volData.getCellSize()
      
      
      Severity: Minor
      Found in packages/miew/src/gfx/geometries/IsoSurface.js - About 1 hr to fix

        Function _fromGeo has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _fromGeo(geoOut) {
            let colors = null
            const positions = utils.allocateTyped(
              Float32Array,
              (1 + 2) * geoOut._numVertices
        Severity: Minor
        Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 1 hr to fix

          Function load has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            load(source, opts) {
              opts = merge({}, opts, {
                context: this
              })
          
          
          Severity: Minor
          Found in packages/miew/src/Miew.ts - About 1 hr to fix

            Function propagateProp has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              propagateProp(path, arg) {
                if (path !== undefined) {
                  let argExc = {}
                  const adapter = options.adapters[typeof get(settings.defaults, path)]
                  if (adapter === undefined) {
            Severity: Minor
            Found in packages/miew-cli/src/Miew-cli.js - About 1 hr to fix

              Function mousedown has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              ObjectControls.prototype.mousedown = function (event) {
                if (this.enabled === false || this._state !== STATE.NONE) {
                  return
                }
              
              
              Severity: Minor
              Found in packages/miew/src/ui/ObjectControls.js - About 1 hr to fix

                Function computeGradient has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  computeGradient() {
                    if (this._dimVec !== 1) {
                      // gradient can only be computed for scalar fields
                      return null
                    }
                Severity: Minor
                Found in packages/miew/src/chem/Volume.js - About 1 hr to fix

                  Function writeString has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    writeString(string, begin, end) {
                      let curStr = this._resultArray[this._currentStr]
                      let str
                  
                      const curStrLength = curStr ? curStr.length : 0
                  Severity: Minor
                  Found in packages/miew/src/io/exporters/PDBResult.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (
                          xDir.x < 0 ||
                          xDir.y < 0 ||
                          xDir.z < 0 ||
                          yDir.x < 0 ||
                    Severity: Critical
                    Found in packages/miew/src/gfx/geometries/IsoSurface.js - About 1 hr to fix

                      Function constructor has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        constructor(
                          ResidueGroup,
                          geoParams,
                          complex,
                          colorer,
                      Severity: Minor
                      Found in packages/miew/src/gfx/modes/processors/SubseqsProcessor.js - About 1 hr to fix

                        Function _addPointsForLoneResidue has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function _addPointsForLoneResidue(centerPoints, topPoints, idx, residue) {
                          const nucleic = (residue._type.flags & ResidueType.Flags.NUCLEIC) !== 0
                          const nameFrom = nucleic ? "C5'" : 'N'
                          const nameTo = nucleic ? "C3'" : 'C'
                        
                        
                        Severity: Minor
                        Found in packages/miew/src/gfx/modes/groups/CartoonHelper.js - About 1 hr to fix

                          Function _breadWidthSearch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            _breadWidthSearch(atoms, molID) {
                              const atomLabels = new Array(atoms.length)
                          
                              let id
                              for (id = 0; id < atomLabels.length; id++) {
                          Severity: Minor
                          Found in packages/miew/src/io/parsers/CMLParser.js - About 1 hr to fix

                            Function initializeTerminal has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function initializeTerminal(viewer) {
                              const _terminal = $('.miew-terminal')
                              const _terminalWindow = _terminal.find('.terminal-window')
                              _terminalWindow.terminal(
                                function (command, term) {
                            Severity: Minor
                            Found in examples/terminal.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language