Showing 711 of 1,553 total issues

Function test_match has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      test_match: function (match, indexed_rule) {
        var token, lines, backup

        if (this.options.backtrack_lexer) {
          // save context
Severity: Major
Found in packages/miew-cli/src/MiewCLIParser.js - About 2 hrs to fix

    Function e has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function e(r, i, o) {
        var a = typeof r
        if ('string' === a) {
          var u = n(r)
          if (32 > u) return i.setUint8(o, 160 | u), t(i, o + 1, r), 1 + u
    Severity: Major
    Found in packages/miew/src/vendors/mmtf.js - About 2 hrs to fix

      Function test_match has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            test_match: function (match, indexed_rule) {
              var token, lines, backup
      
              if (this.options.backtrack_lexer) {
                // save context
      Severity: Major
      Found in packages/miew/src/utils/SelectionParser.js - About 2 hrs to fix

        Function _forEachVoxelWithinRadius has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _forEachVoxelWithinRadius(center, radius, process) {
            const xRange = VoxelWorld._xRange
            const yRange = VoxelWorld._yRange
            const zRange = VoxelWorld._zRange
        
        
        Severity: Major
        Found in packages/miew/src/chem/VoxelWorld.js - About 2 hrs to fix

          Function Picker has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Picker(gfxObj, camera, domElement) {
            EventDispatcher.call(this)
            const self = this
          
            this.gfxObj = gfxObj
          Severity: Major
          Found in packages/miew/src/ui/Picker.js - About 2 hrs to fix

            Function dssp has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              dssp() {
                const ssMap = new SecondaryStructureMap(this)
            
                const structures = (this.structures = [])
                const helices = (this._helices = [])
            Severity: Major
            Found in packages/miew/src/chem/Complex.js - About 2 hrs to fix

              Function parseBinaryData has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                parseBinaryData(arrayBuffer) {
                  const dataView = new DataView(arrayBuffer)
                  let offset = 0
                  const atomsCount = dataView.getUint32(offset, true)
                  offset += 4
              Severity: Major
              Found in packages/miew/src/gfx/FrameInfo.js - About 2 hrs to fix

                Function _onKeyDown has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _onKeyDown(event) {
                    if (!this._running || !this._hotKeysEnabled) {
                      return
                    }
                
                
                Severity: Major
                Found in packages/miew/src/Miew.ts - About 2 hrs to fix

                  Function screenshot has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    screenshot(width, height) {
                      const gfx = this._gfx
                      const deviceWidth = gfx.renderer.domElement.width
                      const deviceHeight = gfx.renderer.domElement.height
                  
                  
                  Severity: Major
                  Found in packages/miew/src/Miew.ts - About 2 hrs to fix

                    Function _fillSelectionColorCombo has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Menu.prototype._fillSelectionColorCombo = function (paletteID) {
                      const self = this
                      const frag = document.createDocumentFragment()
                      const palette = palettes.get(paletteID) || palettes.first
                      const colorList = palette.namedColorsArray
                    Severity: Major
                    Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

                      File readCIF.js has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { set } from 'lodash'
                      import ParsingError from './ParsingError'
                      
                      // Implemented and being tested against: https://www.iucr.org/resources/cif/spec/version1.1/cifsyntax
                      
                      
                      Severity: Minor
                      Found in packages/miew/src/io/parsers/readCIF.js - About 2 hrs to fix

                        Function anonymous has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              performAction: function anonymous(
                                yy,
                                yy_,
                                $avoiding_name_collisions,
                                YY_START
                        Severity: Major
                        Found in packages/miew/src/utils/SelectionParser.js - About 2 hrs to fix

                          Function _fetchData has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function _fetchData(source, opts, job) {
                            return new Promise((resolve) => {
                              if (job.shouldCancel()) {
                                throw new Error('Operation cancelled')
                              }
                          Severity: Major
                          Found in packages/miew/src/Miew.ts - About 2 hrs to fix

                            Function _prepareBuffer has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                              _prepareBuffer(framesStart, framesEnd) {
                                if (framesStart === undefined || framesStart === null) {
                                  framesStart = 0
                                }
                                if (framesEnd === undefined || framesEnd === null) {
                            Severity: Minor
                            Found in packages/miew/src/gfx/FrameInfo.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 rep has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                              rep(index, rep) {
                                // if index is missing then it is the current
                                if (!rep && (index === undefined || index instanceof Object)) {
                                  rep = index
                                  index = this.repCurrent()
                            Severity: Minor
                            Found in packages/miew/src/ComplexVisual.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 dssp has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                              dssp() {
                                const ssMap = new SecondaryStructureMap(this)
                            
                                const structures = (this.structures = [])
                                const helices = (this._helices = [])
                            Severity: Minor
                            Found in packages/miew/src/chem/Complex.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 write_csv has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def write_csv():
                              # create subtotals
                              stats_total = defaultdict(int)
                              stats_props_total = defaultdict(set)
                              for filename, stats, stats_props in files:
                            Severity: Minor
                            Found in demo/tools/pdbfreq.py - 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 _markHeteroAtoms has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                              _markHeteroAtoms(mmtfData) {
                                const chainsInModel0 = mmtfData.chainsPerModel[0]
                                for (let i = 0; i < mmtfData.entityList.length; ++i) {
                                  const entity = mmtfData.entityList[i]
                                  if (entity.type !== 'polymer') {
                            Severity: Minor
                            Found in packages/miew/src/io/parsers/MMTFParser.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 write_csv has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def write_csv():
                              # create subtotals
                              stats_total = defaultdict(int)
                              stats_props_total = defaultdict(set)
                              for filename, stats, stats_props in files:
                            Severity: Minor
                            Found in packages/miew/tools/pdbfreq.py - 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

                            File Instanced2CCylindersGeometry.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import {
                              Color,
                              InstancedBufferAttribute,
                              InstancedBufferGeometry,
                              Matrix4,
                            Severity: Minor
                            Found in packages/miew/src/gfx/geometries/Instanced2CCylindersGeometry.js - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language