Showing 711 of 1,553 total issues

Function updateToFrame has 40 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 residues = frameData.getResidues()
Severity: Minor
Found in packages/miew/src/gfx/modes/groups/ResiduesTraceGroup.js - About 1 hr to fix

    Function _parseAtomsInf has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _parseAtomsInf() {
        const het = true
        const altLoc = ' '
        const occupancy = 1
        const tempFactor = 1
    Severity: Minor
    Found in packages/miew/src/io/parsers/XYZParser.js - About 1 hr to fix

      Function updateCMLData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function updateCMLData(complex) {
            const { root } = self._gfx
            const mat = extractRotation(root.matrixWorld)
            const v4 = new Vector4(0, 0, 0, 0)
            const vCenter = new Vector4(0, 0, 0, 0)
      Severity: Minor
      Found in packages/miew/src/Miew.ts - About 1 hr to fix

        Function _addReprListItem has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        Menu.prototype._addReprListItem = function (panel, index, repr) {
          const self = this
          const reprList = $(
            `${self._menuId} [data-panel-type=miew-menu-panel-representation] .miew-repr-list`
          )
        Severity: Minor
        Found in demo/src/scripts/ui/Menu.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 pickObject has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        Picker.prototype.pickObject = function (screenPos) {
          if (!this.gfxObj) {
            this.picked = {}
            this.dispatchEvent({ type: 'newpick', obj: {} })
            return
        Severity: Minor
        Found in packages/miew/src/ui/Picker.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 rebuildSelectionGeometry has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          rebuildSelectionGeometry() {
            const mask = 1 << this._selectionBit
        
            gfxutils.clearTree(this._selectionGeometry)
        
        
        Severity: Minor
        Found in packages/miew/src/ComplexVisual.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 parse has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          parse(stream) {
            /** @type {?Assembly} */
            let assembly = this._assembly
            /** @type {?Matrix4} */
            let matrix = this._matrix
        Severity: Minor
        Found in packages/miew/src/io/parsers/pdb/Remark350.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 extractArgs has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function extractArgs(input, defaultsDict, params) {
          if (input) {
            const bang = input.indexOf(cOptsSep)
            const inputVal = parseParams(
              input.substr(0, bang >= 0 ? bang : undefined),
        Severity: Minor
        Found in packages/miew/src/options.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 toScript has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function toScript(opts) {
          const commandsList = []
          let idx = 0
          function checkAndAdd(command, value, saveQuotes) {
            if (value !== null && value !== undefined) {
        Severity: Minor
        Found in packages/miew/src/options.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 _resetComponentTransform has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          _resetComponentTransform() {
            const visual = this._complexVisual
            const selection = this._complexVisual.getSelectionGeo()
            let i
            let j
        Severity: Minor
        Found in packages/miew/src/ComplexVisualEdit.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 _onPick has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          _onPick(event) {
            if (!settings.now.picking) {
              // picking is disabled
              return
            }
        Severity: Minor
        Found in packages/miew/src/Miew.ts - 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 _build has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _build() {
            const { residues, parent } = this._selection
            const mode = this._mode
            const colorer = this._colorer
            const geo = this._geo
        Severity: Minor
        Found in packages/miew/src/gfx/modes/groups/ResiduesTraceGroup.js - About 1 hr to fix

          Function toScript has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function toScript(opts) {
            const commandsList = []
            let idx = 0
            function checkAndAdd(command, value, saveQuotes) {
              if (value !== null && value !== undefined) {
          Severity: Minor
          Found in packages/miew/src/options.js - About 1 hr to fix

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

              function fillSingleWords() {
                const frag = document.createDocumentFragment()
                let newItem
                const group = selectionPanel.find('[data-tab-content=singleword]').get(0)
                let i
            Severity: Minor
            Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

              Function _loopThrough has 38 lines of code (exceeds 25 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

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

                  _initVertices(segmentsCount) {
                    this._buffersSize = segmentsCount * VERTEX_PER_SEGMENT
                    const pointsCount = this._buffersSize
                    const use32bitIndex = pointsCount > MAX_IDC_16BIT
                    this._index = utils.allocateTyped(
                Severity: Minor
                Found in packages/miew/src/gfx/geometries/ThickLinesGeometry.js - About 1 hr to fix

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

                    constructor(volume, width, height) {
                      const planeGeo = this._initPlaneGeo(width, height)
                  
                      const mat = new VolumeMaterial.BackFacePosMaterialFarPlane()
                      this._plane = new meshes.Mesh(planeGeo, mat)
                  Severity: Minor
                  Found in packages/miew/src/gfx/VolumeFarPlane.js - About 1 hr to fix

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

                      _fillCmpEdit() {
                        const self = this
                        const components = this._components
                    
                        function addComp() {
                    Severity: Minor
                    Found in packages/miew/src/chem/Complex.js - About 1 hr to fix

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

                        resetReps(reps) {
                          // Create all necessary representations
                          if (this._complex) {
                            this._complex.clearAtomBits(~0)
                          }
                      Severity: Minor
                      Found in packages/miew/src/ComplexVisual.js - About 1 hr to fix

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

                          _traverseData(dom) {
                            function isArray(o) {
                              return Object.prototype.toString.apply(o) === '[object Array]'
                            }
                        
                        
                        Severity: Minor
                        Found in packages/miew/src/io/parsers/CMLParser.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language