Showing 711 of 1,553 total issues

Function repAdd has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  repAdd(rep) {
    if (this._reprList.length >= ComplexVisual.NUM_REPRESENTATION_BITS) {
      return null
    }

Severity: Minor
Found in packages/miew/src/ComplexVisual.js - About 1 hr to fix

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

      Function update has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      ObjectControls.prototype.update = (function () {
        const shift = new Vector2()
      
        return function () {
          const curTime = this._clock.getElapsedTime()
      Severity: Minor
      Found in packages/miew/src/ui/ObjectControls.js - About 1 hr to fix

        Function mouse2rotation has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ObjectHandler.prototype.mouse2rotation = (function () {
          const center = new Vector3()
        
          const eye = new Vector3()
          const eyeDirection = new Vector3()
        Severity: Minor
        Found in packages/miew/src/ui/ObjectControls.js - About 1 hr to fix

          Function calcNormalDir has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            calcNormalDir(posGetter) {
              const left = this._left
              const right = this._right
              let first = left
              let second = right
          Severity: Minor
          Found in packages/miew/src/chem/Bond.js - About 1 hr to fix

            Function _initMiewEventListeners has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Menu.prototype._initMiewEventListeners = function () {
              const self = this
            
              this._viewer.addEventListener('loading', () => {
                self._setTitle('Loading…')
            Severity: Minor
            Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

              Function _term has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  (command, term) => {
                    if (self._viewer) {
                      command = command.trim()
                      const loadStr = command.split(/\s+/)
              
              
              Severity: Minor
              Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

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

                  Function showEnterVR has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function showEnterVR(button) {
                      button.style.display = ''
                      button.style.cursor = 'pointer'
                      button.style.left = 'calc(50% - 50px)'
                      button.style.width = '100px'
                  Severity: Minor
                  Found in packages/miew/src/gfx/vr/createWebVRButton.js - About 1 hr to fix

                    Function _parseAtoms has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _parseAtoms(stream, atomsNum) {
                        let curStr
                        let serial = this._atomsParsed
                    
                        // each molecule = chain\residue
                    Severity: Minor
                    Found in packages/miew/src/io/parsers/SDFParser.js - About 1 hr to fix

                      Function _extractRepresentation has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _extractRepresentation() {
                          const changed = []
                      
                          this._forEachComplexVisual((visual) => {
                            if (visual.getSelectionCount() === 0) {
                      Severity: Minor
                      Found in packages/miew/src/Miew.ts - About 1 hr to fix

                        Function unsupportedIterableToArray has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var unsupportedIterableToArray = createCommonjsModule(function (module) {
                        function _unsupportedIterableToArray(o, minLen) {
                          if (!o) return;
                          if (typeof o === "string") return arrayLikeToArray(o, minLen);
                          var n = Object.prototype.toString.call(o).slice(8, -1);
                        Severity: Minor
                        Found in packages/miew-cli/dist/index.modern.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 createElement has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function createElement(tag, attrs, content) {
                          var element = document.createElement(tag);
                          var i;
                          var n;
                          if (attrs) {
                        Severity: Minor
                        Found in packages/miew-cli/dist/index.modern.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 createElement has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function createElement(tag, attrs, content) {
                          const element = document.createElement(tag)
                          let i
                          let n
                          if (attrs) {
                        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 createElement has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function createElement(tag, attrs, content) {
                          var element = document.createElement(tag);
                          var i;
                          var n;
                          if (attrs) {
                        Severity: Minor
                        Found in packages/miew-cli/dist/index.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 unsupportedIterableToArray has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var unsupportedIterableToArray = createCommonjsModule(function (module) {
                        function _unsupportedIterableToArray(o, minLen) {
                          if (!o) return;
                          if (typeof o === "string") return arrayLikeToArray(o, minLen);
                          var n = Object.prototype.toString.call(o).slice(8, -1);
                        Severity: Minor
                        Found in packages/miew-cli/dist/index.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 _loopThrough has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function _loopThrough(
                          subDiv,
                          residues,
                          segmentsHeight,
                          tension,
                        Severity: Minor
                        Found in packages/miew/src/gfx/modes/groups/ResiduesSubseqGroup.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 createElement has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function createElement(tag, attrs, content) {
                          const element = document.createElement(tag)
                          let i
                          let n
                          if (attrs) {
                        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 parseBinaryData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          parseBinaryData(arrayBuffer) {
                            const dataView = new DataView(arrayBuffer)
                            let offset = 0
                            const atomsCount = dataView.getUint32(offset, true)
                            offset += 4
                        Severity: Minor
                        Found in packages/miew/src/gfx/FrameInfo.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 _forEachAtomWithinDistFromGroup has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _forEachAtomWithinDistFromGroup(forEachAtom, dist, process) {
                            const self = this
                            const r2 = dist * dist
                        
                            const voxels = []
                        Severity: Minor
                        Found in packages/miew/src/chem/VoxelWorld.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

                        Severity
                        Category
                        Status
                        Source
                        Language