Showing 711 of 1,553 total issues

Function buildTiledTexture has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  buildTiledTexture() {
    let tilesX = Math.ceil(Math.sqrt((this._dimZ * this._dimY) / this._dimX))

    let width = tilesX * (this._dimX + 2) - 1
    width = pow2ceil(width)
Severity: Major
Found in packages/miew/src/chem/Volume.js - About 2 hrs to fix

    Function RepresentationMap has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var RepresentationMap = function () {
      function RepresentationMap() {
        _classCallCheck(this, RepresentationMap);
        this.representationMap = {};
        this.representationID = {};
    Severity: Major
    Found in packages/miew-cli/dist/index.modern.js - About 2 hrs to fix

      Function RepresentationMap has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var RepresentationMap = function () {
        function RepresentationMap() {
          _classCallCheck(this, RepresentationMap);
          this.representationMap = {};
          this.representationID = {};
      Severity: Major
      Found in packages/miew-cli/dist/index.js - About 2 hrs to fix

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

          _build() {
            const bondsIdc = this._selection.chunks
            const { bonds, parent } = this._selection
            const mode = this._mode
            const colorer = this._colorer
        Severity: Major
        Found in packages/miew/src/gfx/modes/groups/BondsLinesGroup.js - About 2 hrs to fix

          Function o has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function o() {
                var o,
                  s,
                  f = r[a]
                if (0 === (128 & f)) return a++, f
          Severity: Major
          Found in packages/miew/src/vendors/mmtf.js - About 2 hrs to fix

            Function _tryBond has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _tryBond(prevBond, currRight, currDir) {
                const bondsOrder = []
                const bondsData = this._bondsData
                const currLeft = _anotherAtom(prevBond, currRight)
                const currVec = currRight.position.clone().sub(currLeft.position)
            Severity: Major
            Found in packages/miew/src/chem/AromaticLoopsMarker.js - About 2 hrs to fix

              Function _buildSelectorFromSortedLists has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _buildSelectorFromSortedLists(atoms, residues, chains) {
                  const complex = this._complex
              
                  function optimizeList(list) {
                    const result = []
              Severity: Major
              Found in packages/miew/src/ComplexVisual.js - About 2 hrs to fix

                Function _parseATOM has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _parseATOM(stream) {
                    if (this._modelId !== 1) {
                      return
                    }
                
                
                Severity: Major
                Found in packages/miew/src/io/parsers/PDBParser.js - About 2 hrs to fix

                  Function SphereCollisionGeo has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const SphereCollisionGeo = (base) =>
                    class extends base {
                      constructor(count, ...args) {
                        super(...args)
                        this._objects = new Array(count)
                  Severity: Minor
                  Found in packages/miew/src/gfx/geometries/SphereCollisionGeo.js - About 2 hrs 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 constructor has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                    constructor(
                      radiusTop,
                      radiusBottom,
                      height,
                      radialSegments,
                  Severity: Minor
                  Found in packages/miew/src/gfx/geometries/CylinderBufferGeometry.js - About 2 hrs 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 _forEachSubChain has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                    _forEachSubChain(mask, process) {
                      const residues = this._complex._residues
                      const subs = this._subDivs
                      for (let i = 0, n = subs.length; i < n; ++i) {
                        for (let idx = subs[i].start, last = subs[i].end; idx <= last; ++idx) {
                  Severity: Minor
                  Found in packages/miew/src/chem/Component.js - About 2 hrs 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 a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                    _build() {
                      const self = this
                  
                      for (let i = 0; i < this._complex._residues.length - 1; ++i) {
                        const ri = this._complex._residues[i]
                  Severity: Minor
                  Found in packages/miew/src/chem/HBondInfo.js - About 2 hrs 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 getState has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                    getState(opts) {
                      const state = {}
                  
                      opts = defaults(opts, {
                        compact: true,
                  Severity: Minor
                  Found in packages/miew/src/Miew.ts - About 2 hrs 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 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    updateToFrame(frameData) {
                      const bondsIdc = this._selection.chunks
                      const { bonds } = this._selection
                      const mode = this._mode
                      const colorer = this._colorer
                  Severity: Major
                  Found in packages/miew/src/gfx/modes/groups/BondsCylinderGroup.js - About 2 hrs to fix

                    Function _findPairs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _findPairs() {
                        const vw = this._complex.getVoxelWorld()
                        if (vw === null) {
                          return
                        }
                    Severity: Major
                    Found in packages/miew/src/chem/AutoBond.js - About 2 hrs to fix

                      Function toURL has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function toURL(opts) {
                        const stringList = []
                        let idx = 0
                      
                        function checkAndAdd(prefix, value) {
                      Severity: Major
                      Found in packages/miew/src/options.js - About 2 hrs to fix

                        Function rep has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          rep(index, rep) {
                            // if index is missing then it is the current
                            if (!rep && (index === undefined || index instanceof Object)) {
                              rep = index
                              index = this.repCurrent()
                        Severity: Major
                        Found in packages/miew/src/ComplexVisual.js - About 2 hrs to fix

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

                            _build() {
                              const bondsIdc = this._selection.chunks
                              const { bonds, parent } = this._selection
                              const mode = this._mode
                              const colorer = this._colorer
                          Severity: Major
                          Found in packages/miew/src/gfx/modes/groups/BondsCylinderGroup.js - About 2 hrs to fix

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

                              constructor() {
                                const geo = new BufferGeometry()
                                super(geo)
                                this.clipPlane = new Plane()
                                const size = new Vector3(0.5, 0.5, 0.5)
                            Severity: Major
                            Found in packages/miew/src/gfx/VolumeMesh.js - About 2 hrs to fix

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

                                calculateGridCorners(corners, side, vBoxMin, vBoxMax, atoms, probeRad) {
                                  const side2 = side * side
                                  const side3 = side2 * side
                                  const vCorner = new Vector3()
                                  const vDif = new Vector3()
                              Severity: Minor
                              Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language