Showing 711 of 1,553 total issues

Function addVertexToGeo has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  addVertexToGeo(geoOut, vAdd) {
    let entry
    const oneHynberes = 0.01
    const n815851 = 815851
    const n37633 = 37633
Severity: Major
Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 2 hrs to fix

    Function buildNormals has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      buildNormals(numVertices, vertices, normals) {
        const self = this
        let numCloseAtoms = 0
        let vx = 0
        let vy = 0
    Severity: Major
    Found in packages/miew/src/gfx/geometries/IsosurfaceBuildNormals.js - About 2 hrs to fix

      Function _parseAtom has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _parseAtom(line) {
          this._residueNumber = line.readInt(1, 5)
          this._residueName = line.readString(6, 10).trim()
          this._atomName = line.readString(11, 15).trim()
          this._atomNumber = line.readInt(16, 20)
      Severity: Major
      Found in packages/miew/src/io/parsers/GROParser.js - About 2 hrs to fix

        Function getMiewWithCli has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        var getMiewWithCli = function getMiewWithCli(miewInstance) {
          var obj = Object.create(miewInstance);
          obj.script = function (script, _printCallback, _errorCallback) {
            MiewCLIParser.parser.yy.miew = obj;
            MiewCLIParser.parser.yy.echo = _printCallback;
        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 getMiewWithCli has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        var getMiewWithCli = function getMiewWithCli(miewInstance) {
          var obj = Object.create(miewInstance);
          obj.script = function (script, _printCallback, _errorCallback) {
            MiewCLIParser.parser.yy.miew = obj;
            MiewCLIParser.parser.yy.echo = _printCallback;
        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 getMiewWithCli has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        export const getMiewWithCli = (miewInstance) => {
          const obj = Object.create(miewInstance)
        
          obj.script = function (script, _printCallback, _errorCallback) {
            parsercli.yy.miew = obj
        Severity: Minor
        Found in packages/miew-cli/src/Miew-cli.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 computeBoundaries has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

          computeBoundaries() {
            const atoms = this._complex._atoms
            const n = atoms.length
            const selector = this._selector
        
        
        Severity: Minor
        Found in packages/miew/src/chem/BiologicalUnit.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 _updateInfoPanel has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _updateInfoPanel() {
            const info = this._msgAtomInfo.getElementsByTagName('p')[0]
            let atom
            let residue
        
        
        Severity: Major
        Found in packages/miew/src/Miew.ts - About 2 hrs to fix

          Function _copyCurReprListItem has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Menu.prototype._copyCurReprListItem = function (index) {
            const self = this
            const reprList = $(
              `${self._menuId} .panel-menu[data-panel-type=miew-menu-panel-representation] .miew-repr-list`
            )
          Severity: Major
          Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

            Function _initPresetsPanelActions has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Menu.prototype._initPresetsPanelActions = function () {
              const self = this
            
              self.presetsPanel.actions.pdb.inputs.refresh =
                self._presetsPanelActionsPdbInputsRefresh // check input box?
            Severity: Major
            Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

              Function show has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Menu.prototype.show = function (panelID, menuItem) {
                const self = this
              
                this.setBlur(true)
                this._titlebar.hide()
              Severity: Major
              Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

                Function _parseValue has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function _parseValue() {
                    let val
                    if (
                      (code === 46 || code === 63) &&
                      (i + 1 >= n || _isWhitespace(source.charCodeAt(i + 1)))
                Severity: Major
                Found in packages/miew/src/io/parsers/readCIF.js - About 2 hrs to fix

                  File MOL2Parser.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import Parser from './Parser'
                  import chem from '../../chem'
                  import { Vector3 } from 'three'
                  
                  const { Complex, Element, Bond, Molecule } = chem
                  Severity: Minor
                  Found in packages/miew/src/io/parsers/MOL2Parser.js - About 2 hrs to fix

                    File PDBExporter.js has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { invert } from 'lodash'
                    import Complex from '../../chem/Complex'
                    import Exporter from './Exporter'
                    import PDBResult from './PDBResult'
                    import Assembly from '../../chem/Assembly'
                    Severity: Minor
                    Found in packages/miew/src/io/exporters/PDBExporter.js - About 2 hrs to fix

                      Function next has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            next: function () {
                              if (this.done) {
                                return this.EOF
                              }
                              if (!this._input) {
                      Severity: Major
                      Found in packages/miew-cli/src/MiewCLIParser.js - About 2 hrs to fix

                        Function updateToFrame has 54 lines of code (exceeds 25 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 bondsIdc = this._selection.chunks
                            const { bonds } = this._selection
                        Severity: Major
                        Found in packages/miew/src/gfx/modes/groups/BondsLinesGroup.js - About 2 hrs to fix

                          Function _buildVW has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            _buildVW() {
                              const self = this
                              const residues = this._complex._residues
                              let ri
                              let preri
                          Severity: Major
                          Found in packages/miew/src/chem/HBondInfo.js - About 2 hrs to fix

                            Function _prepareBuffer has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              _prepareBuffer(framesStart, framesEnd) {
                                if (framesStart === undefined || framesStart === null) {
                                  framesStart = 0
                                }
                                if (framesEnd === undefined || framesEnd === null) {
                            Severity: Major
                            Found in packages/miew/src/gfx/FrameInfo.js - About 2 hrs to fix

                              Function buildTiledTexture has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                buildTiledTexture() {
                                  let tilesX = Math.ceil(Math.sqrt((this._dimZ * this._dimY) / this._dimX))
                              
                                  let width = tilesX * (this._dimX + 2) - 1
                                  width = pow2ceil(width)
                              Severity: Major
                              Found in packages/miew/src/chem/Volume.js - About 2 hrs to fix

                                Function next has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      next: function () {
                                        if (this.done) {
                                          return this.EOF
                                        }
                                        if (!this._input) {
                                Severity: Major
                                Found in packages/miew/src/utils/SelectionParser.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language