Showing 711 of 1,553 total issues

Function i has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function _collectCylindersInfo has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _collectCylindersInfo(mesh) {
        const {
          geometry: {
            attributes: { position, color, color2 },
            index
    Severity: Minor
    Found in packages/miew/src/io/exporters/fbx/FBXInfoExtractor.js - About 2 hrs to fix

      Function begin has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        begin() {
          const visual = this._complexVisual
          const selection = this._complexVisual.getSelectionGeo()
      
          const atoms = this._getSelectionBorderAtoms()
      Severity: Minor
      Found in packages/miew/src/ComplexVisualEdit.js - About 2 hrs to fix

        Function view has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          view(expression) {
            const VIEW_VERSION = '1'
            const self = this
            const { pivot } = this._gfx
            let transform = []
        Severity: Minor
        Found in packages/miew/src/Miew.ts - About 2 hrs to fix

          Function getSubset has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getSubset(chunkIndices) {
              const info = _prepareCylinderInfo(chunkIndices)
              const cylinderIndices = info.indices
              const instanceCount = cylinderIndices.length
              const geom = new InstancedBufferGeometry()
          Severity: Minor
          Found in packages/miew/src/gfx/geometries/Instanced2CCylindersGeometry.js - About 1 hr to fix

            Function _forEachVoxelWithinRadiusSimple has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _forEachVoxelWithinRadiusSimple(center, radius, process) {
                const xRange = VoxelWorld._xRange
                const yRange = VoxelWorld._yRange
                const zRange = VoxelWorld._zRange
                const vCenter = VoxelWorld._vCenter
            Severity: Minor
            Found in packages/miew/src/chem/VoxelWorld.js - About 1 hr to fix

              Function _renderVolume has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _renderVolume(volumeVisual, camera, dstBuf, tmpBuf1, tmpBuf2, tmpBuf3) {
                  const volumeBFMat = new VolumeMaterial.BackFacePosMaterial()
                  const volumeFFMat = new VolumeMaterial.FrontFacePosMaterial()
                  const cubeOffsetMat = new Matrix4().makeTranslation(0.5, 0.5, 0.5)
                  const world2colorMat = new Matrix4()
              Severity: Minor
              Found in packages/miew/src/Miew.ts - About 1 hr to fix

                Function _updateSecStructure has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _updateSecStructure(complex, residue, groupData) {
                    const helixClasses = [3, -1, 1, -1, 5]
                
                    if (!isUndefined(groupData) && groupData.secStruct === this._ssType) {
                      residue._secondary = this._ssStruct
                Severity: Minor
                Found in packages/miew/src/io/parsers/MMTFParser.js - About 1 hr to fix

                  Function getAltObj has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    getAltObj() {
                      const res = {
                        objects: [],
                        pivot: new Vector3(0, 0, 0)
                      }
                  Severity: Minor
                  Found in packages/miew/src/ComplexVisualEdit.js - About 1 hr to fix

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

                          next: function next() {
                            if (this.done) {
                              return this.EOF;
                            }
                            if (!this._input) {
                    Severity: Minor
                    Found in packages/miew-cli/dist/index.modern.js - About 1 hr to fix

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

                            next: function next() {
                              if (this.done) {
                                return this.EOF;
                              }
                              if (!this._input) {
                      Severity: Minor
                      Found in packages/miew-cli/dist/index.js - About 1 hr to fix

                        Function _btnToolbarClick has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function _btnToolbarClick() {
                              if (this.classList.contains('disabled')) {
                                return
                              }
                        
                        
                        Severity: Minor
                        Found in demo/src/scripts/ui/Menu.js - About 1 hr to fix

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

                            Function _extractSheets has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              _extractSheets(complex, sheetData) {
                                const { asymDict } = this
                                if (
                                  !sheetData.sheet_id ||
                                  !sheetData.id ||
                            Severity: Minor
                            Found in packages/miew/src/io/parsers/CIFParser.js - About 1 hr to fix

                              Function resolveSourceShortcut has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function resolveSourceShortcut(source, opts) {
                                if (!isString(source)) {
                                  return source
                                }
                              
                              
                              Severity: Minor
                              Found in packages/miew/src/Miew.ts - About 1 hr to fix

                                Function wrapNativeSuper has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                var wrapNativeSuper = createCommonjsModule(function (module) {
                                function _wrapNativeSuper(Class) {
                                  var _cache = typeof Map === "function" ? new Map() : undefined;
                                  module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
                                    if (Class === null || !isNativeFunction(Class)) return Class;
                                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 wrapNativeSuper has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                var wrapNativeSuper = createCommonjsModule(function (module) {
                                function _wrapNativeSuper(Class) {
                                  var _cache = typeof Map === "function" ? new Map() : undefined;
                                  module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
                                    if (Class === null || !isNativeFunction(Class)) return Class;
                                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 _updateReprList has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                Menu.prototype._updateReprList = function () {
                                  const self = this
                                
                                  function _createOptionsFromMVData(index, property, element, itemId) {
                                    const curRep = self._viewer.repGet(index)
                                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 _countMeshTriangles has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function _countMeshTriangles(mesh) {
                                  const geom = mesh.geometry
                                  if (geom instanceof InstancedBufferGeometry) {
                                    const attribs = geom.attributes
                                    for (const property in attribs) {
                                Severity: Minor
                                Found in packages/miew/src/gfx/meshutils.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 getBoundingBox has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  getBoundingBox(atoms, vBoxMin, vBoxMax) {
                                    const bigNum = 10000000.0
                                
                                    vBoxMin.x = vBoxMin.y = vBoxMin.z = bigNum
                                    vBoxMax.x = vBoxMax.y = vBoxMax.z = 0 - bigNum
                                Severity: Minor
                                Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.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