Showing 711 of 1,553 total issues

Function _parseSet has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

  _parseSet(varData) {
    const complex = (this._complex = new Complex())
    const data = varData
    const currentLabel = data.curr
    const { atoms, labels } = data
Severity: Minor
Found in packages/miew/src/io/parsers/CMLParser.js - About 1 day 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

Complex has 65 functions (exceeds 20 allowed). Consider refactoring.
Open

class Complex {
  constructor() {
    this._chains = []
    this._components = []
    this._helices = []
Severity: Major
Found in packages/miew/src/chem/Complex.js - About 1 day to fix

    File IsoSurface.js has 550 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import IsoSurfaceMarchCube from './IsoSurfaceMarchCube'
    import utils from '../../utils'
    import { BufferAttribute, BufferGeometry, Matrix3, Vector3 } from 'three'
    
    const edgeTable = [
    Severity: Major
    Found in packages/miew/src/gfx/geometries/IsoSurface.js - About 1 day to fix

      Function _updateVertices has a Cognitive Complexity of 54 (exceeds 5 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: Minor
      Found in packages/miew/src/gfx/VolumeMesh.js - About 1 day 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 _buildBetaSheets has 209 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _buildBetaSheets() {
          // find bridges
          // check each chain against each other chain, and against itself
          const bridges = []
          for (let a = 0; a < this._complex._chains.length; ++a) {
      Severity: Major
      Found in packages/miew/src/chem/SecondaryStructureMap.js - About 1 day to fix

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

        Menu.prototype._init = function () {
          const self = this
          let selectorHide = null
          let selectorShow = null
          let newPanelId = null
        Severity: Major
        Found in demo/src/scripts/ui/Menu.js - About 1 day to fix

          Function _initSelectionPanel has 187 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Menu.prototype._initSelectionPanel = function () {
            const self = this
            const selectionPanel = $(
              `${self._menuId} [data-panel-type=miew-menu-panel-selection]`
            )
          Severity: Major
          Found in demo/src/scripts/ui/Menu.js - About 7 hrs to fix

            File selectors.test.js has 471 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import chai, { expect } from 'chai'
            import dirtyChai from 'dirty-chai'
            import proxyquire from 'proxyquire'
            import selectors from './selectors'
            import ResidueType from './ResidueType'
            Severity: Minor
            Found in packages/miew/src/chem/selectors.test.js - About 7 hrs to fix

              Function parse has 182 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/src/MiewCLIParser.js - About 7 hrs to fix

                Function parse has 182 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/src/utils/SelectionParser.js - About 7 hrs to fix

                  File SecondaryStructureMap.js has 462 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import HBondInfo from './HBondInfo'
                  import ResidueType from './ResidueType'
                  
                  const BridgeType = Object.freeze({
                    NO_BRIDGE: 0,
                  Severity: Minor
                  Found in packages/miew/src/chem/SecondaryStructureMap.js - About 7 hrs to fix

                    Function _selectComponents has a Cognitive Complexity of 46 (exceeds 5 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: Minor
                    Found in packages/miew/src/io/parsers/CMLParser.js - About 7 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 CLIUtils has 176 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var CLIUtils = function () {
                      function CLIUtils() {
                        _classCallCheck(this, CLIUtils);
                      }
                      _createClass(CLIUtils, [{
                    Severity: Major
                    Found in packages/miew-cli/dist/index.modern.js - About 7 hrs to fix

                      Function CLIUtils has 176 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var CLIUtils = function () {
                        function CLIUtils() {
                          _classCallCheck(this, CLIUtils);
                        }
                        _createClass(CLIUtils, [{
                      Severity: Major
                      Found in packages/miew-cli/dist/index.js - About 7 hrs to fix

                        File utils.js has 447 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import logger from './logger'
                        import {
                          assign,
                          isPlainObject,
                          forIn,
                        Severity: Minor
                        Found in packages/miew-cli/src/utils.js - About 6 hrs to fix

                          File utils.js has 447 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import logger from './utils/logger'
                          import {
                            assign,
                            isPlainObject,
                            forIn,
                          Severity: Minor
                          Found in packages/miew/src/utils.js - About 6 hrs to fix

                            Function anonymous has 168 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
                                    switch ($avoiding_name_collisions) {
                                      case 0
                                      :
                                        break;
                            Severity: Major
                            Found in packages/miew-cli/dist/index.modern.js - About 6 hrs to fix

                              Function anonymous has 168 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
                                      switch ($avoiding_name_collisions) {
                                        case 0
                                        :
                                          break;
                              Severity: Major
                              Found in packages/miew-cli/dist/index.js - About 6 hrs to fix

                                Function _parseSet has 165 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  _parseSet(varData) {
                                    const complex = (this._complex = new Complex())
                                    const data = varData
                                    const currentLabel = data.curr
                                    const { atoms, labels } = data
                                Severity: Major
                                Found in packages/miew/src/io/parsers/CMLParser.js - About 6 hrs to fix

                                  File options.test.js has 441 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { isArray, isEqual } from 'lodash'
                                  import chai, { expect } from 'chai'
                                  import dirtyChai from 'dirty-chai'
                                  import options from './options'
                                  
                                  
                                  Severity: Minor
                                  Found in packages/miew/src/options.test.js - About 6 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language