Showing 711 of 1,553 total issues

Function render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    return (
      <div>
        <ViewerContainer onChange={this._onViewerChange} />
        <div style={{ 'padding-top': '0.5em' }}>
Severity: Minor
Found in examples/miew_via_react/App.js - About 1 hr to fix

    Function _initLoadPanel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Menu.prototype._initLoadPanel = function () {
      const self = this
    
      $(
        `${self._menuId} [data-form-type=miew-menu-form-load-pdb] [data-tooltip="tooltip"]`
    Severity: Minor
    Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

      Function DebugTracer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function DebugTracer(namespace) {
        let enabled = false
      
        this.enable = function (on) {
          enabled = on
      Severity: Minor
      Found in packages/miew-cli/src/utils.js - About 1 hr to fix

        Function DebugTracer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function DebugTracer(namespace) {
          let enabled = false
        
          this.enable = function (on) {
            enabled = on
        Severity: Minor
        Found in packages/miew/src/utils.js - About 1 hr to fix

          Function processTransparentMaterial has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const processTransparentMaterial = (function () {
            const matValues = {
              prepassTransparancy: true,
              fakeOpacity: false,
              transparent: false,
          Severity: Minor
          Found in packages/miew/src/gfx/meshutils.js - About 1 hr to fix

            Function buildGeometry has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              buildGeometry(complex, colorer, mask, material) {
                const polyComplexity = this.opts.polyComplexity
                  ? this.opts.polyComplexity[this.settings.now.resolution]
                  : 0
                const groupList = this.depGroups
            Severity: Minor
            Found in packages/miew/src/gfx/modes/Mode.js - About 1 hr to fix

              Function addPair has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                addPair(indexA, indexB) {
                  const ia = indexA < indexB ? indexA : indexB
                  const ib = indexA > indexB ? indexA : indexB
                  const codeToAdd = ia + (ib << cMaxNeighbours)
              
              
              Severity: Minor
              Found in packages/miew/src/chem/AtomPairs.js - About 1 hr to fix

                Function compare has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  compare(repSettings) {
                    const diff = {}
                
                    const selStr = String(this.selector)
                    if (
                Severity: Minor
                Found in packages/miew/src/gfx/Representation.js - About 1 hr to fix

                  Function parseNode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function parseNode(xmlNode, result) {
                        if (xmlNode.nodeName === '#text' && xmlNode.nodeValue.trim() === '') {
                          return
                        }
                  
                  
                  Severity: Minor
                  Found in packages/miew/src/io/parsers/CMLParser.js - About 1 hr to fix

                    Function _setOrigins has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _setOrigins() {
                        const [xaxis, yaxis, zaxis] = this._getAxis()
                        this._setAxisIndices()
                    
                        const header = this._header
                    Severity: Minor
                    Found in packages/miew/src/io/parsers/CCP4Parser.js - About 1 hr to fix

                      Function _extractAssemblies has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _extractAssemblies(complex, complexData) {
                          const { asymDict } = this
                          const asmGen = complexData.pdbx_struct_assembly_gen
                          if (!asmGen) {
                            return
                      Severity: Minor
                      Found in packages/miew/src/io/parsers/CIFParser.js - About 1 hr to fix

                        Function _startAnimation has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          _startAnimation(fileData) {
                            this._stopAnimation()
                            const self = this
                            const visual = this._getComplexVisual()
                            if (visual === null) {
                        Severity: Minor
                        Found in packages/miew/src/Miew.ts - About 1 hr to fix

                          Function getOBB has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            getOBB(matrix, OBB) {
                              this._bBox.makeEmpty()
                          
                              this._forEachVisual((visual) => {
                                this._bSphereForOneVisual.copy(visual.getBoundaries().boundingSphere)
                          Severity: Minor
                          Found in packages/miew/src/Miew.ts - About 1 hr to fix

                            Function createClass has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                            var createClass = createCommonjsModule(function (module) {
                            function _defineProperties(target, props) {
                              for (var i = 0; i < props.length; i++) {
                                var descriptor = props[i];
                                descriptor.enumerable = descriptor.enumerable || false;
                            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 createClass has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                            var createClass = createCommonjsModule(function (module) {
                            function _defineProperties(target, props) {
                              for (var i = 0; i < props.length; i++) {
                                var descriptor = props[i];
                                descriptor.enumerable = descriptor.enumerable || false;
                            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 _calcPoints has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function _calcPoints(residues, firstIdx, lastIdx, boundaries) {
                              const left = boundaries.start
                              const right = boundaries.end
                              function _prevIdx(idx) {
                                return idx > left && residues[idx - 1]._isValid ? idx - 1 : idx
                            Severity: Minor
                            Found in packages/miew/src/gfx/modes/groups/CartoonHelper.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 updateToFrame has a Cognitive Complexity of 10 (exceeds 5 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

                            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 mouseup has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                            Picker.prototype.mouseup = function (event) {
                              const self = this
                            
                              event.preventDefault()
                              event.stopPropagation()
                            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 _parseAtoms has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                              _parseAtoms(atomsNum, MOL2Data) {
                                this._toHeaderString('ATOM', MOL2Data)
                            
                                for (let i = 0; i < atomsNum; i++) {
                                  const parsedStr = splitToFields(MOL2Data[++this._currPosIdx])
                            Severity: Minor
                            Found in packages/miew/src/io/parsers/MOL2Parser.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 _fixDir has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                              _fixDir(refPoint, currDir, posGetter) {
                                // count atoms to the right and to the left of the current plane
                                let rightCount = 0
                                let leftCount = 0
                                const tmpVec = refPoint.clone()
                            Severity: Minor
                            Found in packages/miew/src/chem/Bond.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