Showing 711 of 1,553 total issues

Function _calcHBondEnergy has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  _calcHBondEnergy(predonor, donor, acceptor) {
    let result = 0

    if (predonor === null) {
      return result
Severity: Minor
Found in packages/miew/src/chem/HBondInfo.js - About 3 hrs 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 updateSelectionMask has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  updateSelectionMask(pickedObj) {
    const self = this
    const { atom } = pickedObj
    let { residue, chain, molecule } = pickedObj
    const setMask = 1 << this._selectionBit
Severity: Minor
Found in packages/miew/src/ComplexVisual.js - About 3 hrs 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 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _parseSTRUCTURE(stream, pars, adder) {
    const startId = 0
    const startIndex = 1
    const endId = 2
    const endIndex = 3
Severity: Major
Found in packages/miew/src/io/parsers/PDBParser.js - About 3 hrs to fix

    File Residue.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import Atom from './Atom'
    import Element from './Element'
    import { Vector3 } from 'three'
    
    const cNucleicControlNames = ["C3'", 'C3*', 'P', 'H5T', 'H3T']
    Severity: Minor
    Found in packages/miew/src/chem/Residue.js - About 3 hrs to fix

      Function _fillCombo has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Menu.prototype._fillCombo = function (type, name, path, entityList) {
        const self = this
        const frag = document.createDocumentFragment()
        let newItem
      
      
      Severity: Major
      Found in demo/src/scripts/ui/Menu.js - About 3 hrs to fix

        Function _renderObject has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _renderObject(object, camera, scene) {
            function lerpColorAsHex(a, b, t) {
              tempColor.setHex(a)
              tempColor.lerp(b, t)
              return `#${tempColor.getHexString()}`
        Severity: Major
        Found in packages/miew/src/gfx/CSS2DRenderer.js - About 2 hrs to fix

          Function _performAO has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _performAO(
              srcColorBuffer,
              normalBuffer,
              srcDepthTexture,
              targetBuffer,
          Severity: Major
          Found in packages/miew/src/Miew.ts - About 2 hrs to fix

            File selectArgs.test.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import chai, { expect } from 'chai'
            import dirtyChai from 'dirty-chai'
            import { Range, RangeList, ValueList } from './selectArgs'
            
            chai.use(dirtyChai)
            Severity: Minor
            Found in packages/miew/src/chem/selectors/selectArgs.test.js - About 2 hrs to fix

              Function getMiewWithCli has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const getMiewWithCli = (miewInstance) => {
                const obj = Object.create(miewInstance)
              
                obj.script = function (script, _printCallback, _errorCallback) {
                  parsercli.yy.miew = obj
              Severity: Major
              Found in packages/miew-cli/src/Miew-cli.js - About 2 hrs to fix

                Function RepresentationMap has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                var RepresentationMap = function () {
                  function RepresentationMap() {
                    _classCallCheck(this, RepresentationMap);
                    this.representationMap = {};
                    this.representationID = {};
                Severity: Minor
                Found in packages/miew-cli/dist/index.js - About 2 hrs 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 RepresentationMap has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                var RepresentationMap = function () {
                  function RepresentationMap() {
                    _classCallCheck(this, RepresentationMap);
                    this.representationMap = {};
                    this.representationID = {};
                Severity: Minor
                Found in packages/miew-cli/dist/index.modern.js - About 2 hrs 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 getNumIntersectedCells has a Cognitive Complexity of 21 (exceeds 5 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 2 hrs 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 _renderObject has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                  _renderObject(object, camera, scene) {
                    function lerpColorAsHex(a, b, t) {
                      tempColor.setHex(a)
                      tempColor.lerp(b, t)
                      return `#${tempColor.getHexString()}`
                Severity: Minor
                Found in packages/miew/src/gfx/CSS2DRenderer.js - About 2 hrs 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 _breadWidthSearch has a Cognitive Complexity of 21 (exceeds 5 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 2 hrs 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 _extractSGroup has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                  _extractSGroup(molecule, moleculeArr) {
                    if (!Array.isArray(moleculeArr)) {
                      moleculeArr = []
                    }
                
                
                Severity: Minor
                Found in packages/miew/src/io/parsers/CMLParser.js - About 2 hrs 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 _extractOperations has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                function _extractOperations(assemblyGen, opsDict) {
                  assemblyGen = isString(assemblyGen) ? assemblyGen : `${assemblyGen}`
                  const l = assemblyGen.replace(/\)\s*\(/g, '!').replace(/[()']/g, '')
                  const groupStr = l.split('!')
                  const gps = []
                Severity: Minor
                Found in packages/miew/src/io/parsers/CIFParser.js - About 2 hrs 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 gaussdensity has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  gaussdensity(surface, packedArrays, atomicNum, params) {
                    const numAtoms = packedArrays.posRad.length / 4
                    const { posRad, colors } = packedArrays
                    const { numVoxels } = this
                    const { radScale, gaussLim, gridSpacing } = params
                Severity: Major
                Found in packages/miew/src/gfx/geometries/QuickSurfGeometry.js - About 2 hrs to fix

                  Function _init has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _init(instanceCount, cylinderGeo, useZSprites) {
                      this.copy(cylinderGeo)
                      this._matVector1 = utils.allocateTyped(
                        Float32Array,
                        instanceCount * OFFSET_SIZE
                  Severity: Major
                  Found in packages/miew/src/gfx/geometries/Instanced2CCylindersGeometry.js - About 2 hrs to fix

                    Function _extractConfs has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _extractConfs(complex, helicesData) {
                        const { asymDict } = this
                        if (
                          !helicesData.conf_type_id ||
                          !helicesData.beg_label_seq_id ||
                    Severity: Major
                    Found in packages/miew/src/io/parsers/CIFParser.js - About 2 hrs to fix

                      Function projectPoints has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function projectPoints() {
                          // For each atom:
                          //     Iterate over a subsection of the grid, for each point:
                          //         If current value < 0.0, unvisited, set positive
                          //
                      Severity: Major
                      Found in packages/miew/src/gfx/geometries/ContactSurface.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language