Showing 711 of 1,553 total issues

Function _build has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _build() {
    const self = this
    this._hbonds = new HBondInfo(this._complex)
    this._ss = [] // DSSP map by residue

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

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

      Function _enableMRT has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _enableMRT(on, renderBuffer, textureBuffer) {
          const gfx = this._gfx
          const gl = gfx.renderer.getContext()
          const ext = gl.getExtension('WEBGL_draw_buffers')
          const { properties } = gfx.renderer
      Severity: Minor
      Found in packages/miew/src/Miew.ts - About 1 hr to fix

        Function _parseData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function _parseData(data, opts, job) {
          if (job.shouldCancel()) {
            return Promise.reject(new Error('Operation cancelled'))
          }
        
        
        Severity: Minor
        Found in packages/miew/src/Miew.ts - About 1 hr to fix

          Function addVertexToGeo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            addVertexToGeo(geoOut, vAdd) {
              let entry
              const oneHynberes = 0.01
              const n815851 = 815851
              const n37633 = 37633
          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

          Function _buildInner has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            _buildInner(radOffset, addChunk) {
              const chunksToIdx = this._selection.chunks
          
              const prevVector = new Vector3()
              const currVector = new Vector3()
          Severity: Minor
          Found in packages/miew/src/gfx/modes/groups/AromaticGroup.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 11 (exceeds 5 allowed). Consider refactoring.
          Open

            updateToFrame(frameData) {
              const bondsIdc = this._selection.chunks
              const { bonds } = this._selection
              const mode = this._mode
              const colorer = this._colorer
          Severity: Minor
          Found in packages/miew/src/gfx/modes/groups/BondsCylinderGroup.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 _forEachVoxelWithinRadiusSimple has a Cognitive Complexity of 11 (exceeds 5 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

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

            writeEntireString(string, maxStrPos, concat) {
              if (!maxStrPos) {
                maxStrPos = 81
              }
              for (let j = 0; j < string.length; j++) {
          Severity: Minor
          Found in packages/miew/src/io/exporters/PDBResult.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 resetReps has a Cognitive Complexity of 11 (exceeds 5 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

          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 _extractSheets has a Cognitive Complexity of 11 (exceeds 5 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

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

            center(selector) {
              // no arguments - center on current selection;
              if (selector === undefined) {
                this.setPivotSubset()
                this._needRender = true
          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 _onKeyDown has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            _onKeyDown(event) {
              if (!this._running || !this._hotKeysEnabled) {
                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 begin has a Cognitive Complexity of 11 (exceeds 5 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 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 view has a Cognitive Complexity of 11 (exceeds 5 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 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 DebugTracer has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function DebugTracer(namespace) {
            var enabled = false;
            this.enable = function (on) {
              enabled = on;
            };
          Severity: Minor
          Found in packages/miew-cli/dist/index.modern.js - About 1 hr to fix

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

            function DebugTracer(namespace) {
              var enabled = false;
              this.enable = function (on) {
                enabled = on;
              };
            Severity: Minor
            Found in packages/miew-cli/dist/index.js - About 1 hr to fix

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

                constructor(instanceCount, opts) {
                  super()
                  this._opts = opts
                  this.items = []
                  this.needsUpdate = false
              Severity: Minor
              Found in packages/miew/src/gfx/geometries/LabelsGeometry.js - About 1 hr to fix

                Function _createExtrudedChunkGeometry has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function _createExtrudedChunkGeometry(shape, ringsCount) {
                  const geo = new BufferGeometry()
                  const ptsCount = shape.length
                  const totalPts = ptsCount * ringsCount
                  const type = totalPts <= 65536 ? Uint16Array : Uint32Array
                Severity: Minor
                Found in packages/miew/src/gfx/geometries/ExtrudedObjectsGeometry.js - About 1 hr to fix

                  Function _init has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _init(chunkGeo, chunksCount) {
                      const chunkSize = (this._chunkSize = chunkGeo.attributes.position.count)
                      const chunkIndex = chunkGeo.index.array
                      const chunkIndexSize = chunkIndex.length
                      const pointsCount = this._chunkSize * chunksCount
                  Severity: Minor
                  Found in packages/miew/src/gfx/geometries/ChunkedObjectsGeometry.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language