Showing 711 of 1,553 total issues

Function intersectVisibleObject has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function enable has 26 lines of code (exceeds 25 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 1 hr to fix

      Function _Remark350 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _Remark350(result) {
          if (!this._source.units) {
            return
          }
          const { units } = this._source
      Severity: Minor
      Found in packages/miew/src/io/exporters/PDBExporter.js - About 1 hr to fix

        Function _extractATOM has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _extractATOM(result) {
            if (!this._source._atoms) {
              return
            }
            const atoms = this._source._atoms
        Severity: Minor
        Found in packages/miew/src/io/exporters/PDBExporter.js - About 1 hr to fix

          Function _extractSGroup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _extractSGroup(molecule, moleculeArr) {
              if (!Array.isArray(moleculeArr)) {
                moleculeArr = []
              }
          
          
          Severity: Minor
          Found in packages/miew/src/io/parsers/CMLParser.js - About 1 hr to fix

            Function parseSync has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              parseSync() {
                /* Create "Complex" variable */
                const result = (this._complex = new Complex())
                /* Parse input file line-by-line */
                const reader = new GROReader(this._data)
            Severity: Minor
            Found in packages/miew/src/io/parsers/GROParser.js - About 1 hr to fix

              Function _setBoxParams has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _setBoxParams(xaxis, yaxis, zaxis) {
                  // if axes are not orthogonal, the origins might not match with box coordinates - need to make shift
                  let shiftX = 0
                  let shiftY = 0
                  const [alpha, beta, gamma] = this._header.angles
              Severity: Minor
              Found in packages/miew/src/io/parsers/VolumeModel.js - About 1 hr to fix

                Function _rebuildObjects has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _rebuildObjects() {
                    const self = this
                    const gfx = this._gfx
                    let i
                    let n
                Severity: Minor
                Found in packages/miew/src/Miew.ts - About 1 hr to fix

                  Function _export has 26 lines of code (exceeds 25 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 1 hr to fix

                    Function onError has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function onError(err) {
                      const doc = document.createDocumentFragment()
                    
                      const containers = document.getElementsByClassName('miew-container')
                      const parent = containers.length > 0 ? containers[0] : null
                    Severity: Minor
                    Found in demo/src/scripts/index.js - About 55 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 _initSelectionPanel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Menu.prototype._initSelectionPanel = function () {
                      const self = this
                      const selectionPanel = $(
                        `${self._menuId} [data-panel-type=miew-menu-panel-selection]`
                      )
                    Severity: Minor
                    Found in demo/src/scripts/ui/Menu.js - About 55 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 _calcChunksList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _calcChunksList(mask, innerOnly) {
                        const chunksList = []
                        const { bonds } = this._selection
                        const chunksToIdx = this._chunksIdc
                        for (let i = 0, n = chunksToIdx.length; i < n; ++i) {
                    Severity: Minor
                    Found in packages/miew/src/gfx/modes/groups/BondsGroup.js - About 55 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 updateToFrame has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      updateToFrame(frameData) {
                        // This method looks like a copy paste. However, it
                        // was decided to postpone animation refactoring until GFX is fixed.
                        const opts = this._mode.getLabelOpts()
                        const atomsIdc = this._selection.chunks
                    Severity: Minor
                    Found in packages/miew/src/gfx/modes/groups/AtomsTextGroup.js - About 55 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 buildNormals has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      buildNormals(numVertices, vertices, normals) {
                        const self = this
                        let numCloseAtoms = 0
                        let vx = 0
                        let vy = 0
                    Severity: Minor
                    Found in packages/miew/src/gfx/geometries/IsosurfaceBuildNormals.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      addPair(indexA, indexB) {
                        const ia = indexA < indexB ? indexA : indexB
                        const ib = indexA > indexB ? indexA : indexB
                        const codeToAdd = ia + (ib << cMaxNeighbours)
                    
                    
                    Severity: Minor
                    Found in packages/miew/src/chem/AtomPairs.js - About 55 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 _tryBond has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _tryBond(prevBond, currRight, currDir) {
                        const bondsOrder = []
                        const bondsData = this._bondsData
                        const currLeft = _anotherAtom(prevBond, currRight)
                        const currVec = currRight.position.clone().sub(currLeft.position)
                    Severity: Minor
                    Found in packages/miew/src/chem/AromaticLoopsMarker.js - About 55 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 _parseSTRUCTURE has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _parseSTRUCTURE(stream, pars, adder) {
                        const startId = 0
                        const startIndex = 1
                        const endId = 2
                        const endIndex = 3
                    Severity: Minor
                    Found in packages/miew/src/io/parsers/PDBParser.js - About 55 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 _extractATOM has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _extractATOM(result) {
                        if (!this._source._atoms) {
                          return
                        }
                        const atoms = this._source._atoms
                    Severity: Minor
                    Found in packages/miew/src/io/exporters/PDBExporter.js - About 55 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 _rebuidBondIndexes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _rebuidBondIndexes(atoms, bonds) {
                        const count = atoms.length
                        for (let i = 0; i < count; i++) {
                          const atomId = atoms[i].id
                    
                    
                    Severity: Minor
                    Found in packages/miew/src/io/parsers/CMLParser.js - About 55 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 resolveSourceShortcut has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function resolveSourceShortcut(source, opts) {
                      if (!isString(source)) {
                        return source
                      }
                    
                    
                    Severity: Minor
                    Found in packages/miew/src/Miew.ts - About 55 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