Showing 711 of 1,553 total issues

Function parse has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    parse: function parse(input) {
      var self = this,
          stack = [0],
          tstack = [],
          vstack = [null],
Severity: Major
Found in packages/miew-cli/dist/index.modern.js - About 5 hrs to fix

    Function modifyExcludedFromGeo has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

      modifyExcludedFromGeo(
        side,
        probeSphereRadius,
        vBoxMin,
        vBoxMax,
    Severity: Minor
    Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 5 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

    File Miew-cli.js has 392 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Miew } from 'miew'
    import { parser as parsercli } from './MiewCLIParser'
    import clihelp from './MiewCLIHelp'
    import logger from './logger'
    import { slice, sortBy, get, keys, isUndefined, set, assign } from 'lodash'
    Severity: Minor
    Found in packages/miew-cli/src/Miew-cli.js - About 5 hrs to fix

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

        constructor(
          radiusTop,
          radiusBottom,
          height,
          radialSegments,
      Severity: Major
      Found in packages/miew/src/gfx/geometries/CylinderBufferGeometry.js - About 5 hrs to fix

        File PDBParser.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { isString, isUndefined } from 'lodash'
        import Parser from './Parser'
        import chem from '../../chem'
        import Remark290 from './pdb/Remark290'
        import Remark350 from './pdb/Remark350'
        Severity: Minor
        Found in packages/miew/src/io/parsers/PDBParser.js - About 5 hrs to fix

          Function _fillReprList has 128 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Menu.prototype._fillReprList = function () {
            const self = this
            const reprList = $(
              `${self._menuId} .panel-menu[data-panel-type=miew-menu-panel-representation] .miew-repr-list`
            )
          Severity: Major
          Found in demo/src/scripts/ui/Menu.js - About 5 hrs to fix

            Function _initializeTerminal has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            Menu.prototype._initializeTerminal = function () {
              const self = this
              let res = null
              let urlSubString = ''
              const element = $(
            Severity: Minor
            Found in demo/src/scripts/ui/Menu.js - About 5 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 _doGridPosNorms has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _doGridPosNorms(isoValue, step, appendSimple) {
                const vol = this._volumetricData
                const volData = this._volumetricData.getData()
                const dim = vol.getDimensions()
                const xSize = dim[0]
            Severity: Major
            Found in packages/miew/src/gfx/geometries/IsoSurface.js - About 4 hrs to fix

              Function K has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function K(r, t, n) {
                  n = n || {}
                  var e,
                    i,
                    o,
              Severity: Major
              Found in packages/miew/src/vendors/mmtf.js - About 4 hrs to fix

                ComplexVisual has 37 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class ComplexVisual extends Visual {
                  constructor(name, dataSource) {
                    super(name, dataSource)
                    this._complex = dataSource
                
                
                Severity: Minor
                Found in packages/miew/src/ComplexVisual.js - About 4 hrs to fix

                  File VolumeMesh.js has 368 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import VolumeMaterial from './shaders/VolumeMaterial'
                  import settings from '../settings'
                  import {
                    BufferAttribute,
                    BufferGeometry,
                  Severity: Minor
                  Found in packages/miew/src/gfx/VolumeMesh.js - About 4 hrs to fix

                    File FBXResult.js has 366 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // Forming default definitions block
                    const defaultDefinitions = `
                    Definitions:  {
                      Version: 100
                      Count: 3
                    Severity: Minor
                    Found in packages/miew/src/io/exporters/fbx/FBXResult.js - About 4 hrs to fix

                      Function AVHash has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function AVHash(posRad, min, max, maxDistance) {
                        const itemSize = 4
                        const nAtoms = posRad.length / itemSize
                      
                        const minX = min[0]
                      Severity: Minor
                      Found in packages/miew/src/gfx/geometries/ContactSurface.js - About 4 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 _parseAssemblyInfo has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                      Open

                        _parseAssemblyInfo(mmtfData) {
                          let i
                          let j
                          let k
                          const assemblies = []
                      Severity: Minor
                      Found in packages/miew/src/io/parsers/MMTFParser.js - About 4 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 _doGridPosNorms has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                      Open

                        _doGridPosNorms(isoValue, step, appendSimple) {
                          const vol = this._volumetricData
                          const volData = this._volumetricData.getData()
                          const dim = vol.getDimensions()
                          const xSize = dim[0]
                      Severity: Minor
                      Found in packages/miew/src/gfx/geometries/IsoSurface.js - About 4 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 _selectComponents has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _selectComponents(text) {
                          const parser = new DOMParser()
                          const doc = parser.parseFromString(text, 'application/xml')
                          const traversedData = this._traverseData(doc)
                          let rawData
                      Severity: Major
                      Found in packages/miew/src/io/parsers/CMLParser.js - About 4 hrs to fix

                        Function createVoxels has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          createVoxels() {
                            let numAtomsRefs
                            let rad
                            const ATOM_VOXEL_REF_SCALE = 4.5
                        
                        
                        Severity: Major
                        Found in packages/miew/src/gfx/geometries/IsosurfaceBuildNormals.js - About 4 hrs to fix

                          Function _updateVertices has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            _updateVertices() {
                              // Algorithm:
                              // 1. Get plane parameters
                              // 2. Compute culling flags for all vertices
                              // 3. If intersection occurs => compute from 3 to 6 intersection points
                          Severity: Major
                          Found in packages/miew/src/gfx/VolumeMesh.js - About 4 hrs to fix

                            Function _buildAlphaHelices has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              _buildAlphaHelices(inResidues, chainLength, inPreferPiHelices) {
                                // Helix and Turn
                                for (let stride = 3; stride <= 5; ++stride) {
                                  if (inResidues.length < stride) {
                                    break
                            Severity: Major
                            Found in packages/miew/src/chem/SecondaryStructureMap.js - About 4 hrs to fix

                              Function _presetsPanelActionsPdbInputsRefresh has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Menu.prototype._presetsPanelActionsPdbInputsRefresh = function (self) {
                                const loadPdbButton = $(
                                  `${self._menuId} .presets-panel-action[data-presets-panel-action=pdb-load]`
                                )
                                const clearInputsButton = $(
                              Severity: Minor
                              Found in demo/src/scripts/ui/Menu.js - About 4 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

                              Severity
                              Category
                              Status
                              Source
                              Language