Showing 711 of 1,553 total issues

Function projectTorus has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function projectTorus(a, b) {
    const aIdx = itemSize * a
    const bIdx = itemSize * b
    const xa = posRad[aIdx]
    const ya = posRad[aIdx + 1]
Severity: Major
Found in packages/miew/src/gfx/geometries/ContactSurface.js - About 2 hrs to fix

    Function exportCML has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      exportCML() {
        const self = this
    
        function extractRotation(m) {
          const xAxis = new Vector3()
    Severity: Major
    Found in packages/miew/src/Miew.ts - About 2 hrs to fix

      File IsosurfaceBuildNormals.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import utils from '../../utils'
      import { Vector3 } from 'three'
      
      // suppress some JSHint warnings
      /* jshint bitwise: false */
      Severity: Minor
      Found in packages/miew/src/gfx/geometries/IsosurfaceBuildNormals.js - About 2 hrs to fix

        Function modifyExcludedFromGeo has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          modifyExcludedFromGeo(
            side,
            probeSphereRadius,
            vBoxMin,
            vBoxMax,
        Severity: Major
        Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 2 hrs to fix

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

            constructor(type, dimensions, box, vecSize, data, volumeInfo) {
              this._box = box.clone()
              this._dimVec = Math.max(Math.floor(vecSize || 1), 1)
              this._volumeInfo = volumeInfo
          
          
          Severity: Major
          Found in packages/miew/src/chem/Volume.js - About 2 hrs to fix

            Function joinComplexes has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              joinComplexes(complexes) {
                // clear target complex
                this._chains = []
                this._components = []
                this._helices = []
            Severity: Major
            Found in packages/miew/src/chem/Complex.js - About 2 hrs to fix

              Function iterableToArrayLimit has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              var iterableToArrayLimit = createCommonjsModule(function (module) {
              function _iterableToArrayLimit(arr, i) {
                var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
                if (_i == null) return;
                var _arr = [];
              Severity: Minor
              Found in packages/miew-cli/dist/index.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 iterableToArrayLimit has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              var iterableToArrayLimit = createCommonjsModule(function (module) {
              function _iterableToArrayLimit(arr, i) {
                var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
                if (_i == null) return;
                var _arr = [];
              Severity: Minor
              Found in packages/miew-cli/dist/index.modern.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 _updateIndices has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                _updateIndices() {
                  // Algorithm:
                  // 1. Get plane vertices (from 3 to 6 vertices)
                  // 2. Get "right" vector in plane
                  // 3. Sort vertices using Graham-like method
              Severity: Minor
              Found in packages/miew/src/gfx/VolumeMesh.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 _traverseData has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                _traverseData(dom) {
                  function isArray(o) {
                    return Object.prototype.toString.apply(o) === '[object Array]'
                  }
              
              
              Severity: Minor
              Found in packages/miew/src/io/parsers/CMLParser.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 _fromArray has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              function _fromArray(entries) {
                repIndex = 0
                const opts = {}
                for (let i = 0, n = entries.length; i < n; ++i) {
                  const /** string[] */ entry = entries[i]
              Severity: Minor
              Found in packages/miew/src/options.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

              File Palette.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { assign } from 'lodash'
              
              function clamp(x, a, b) {
                return x <= b ? (x < 0 ? 0 : x) : b
              }
              Severity: Minor
              Found in packages/miew/src/gfx/palettes/Palette.js - About 2 hrs to fix

                Function _updateIndices has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _updateIndices() {
                    // Algorithm:
                    // 1. Get plane vertices (from 3 to 6 vertices)
                    // 2. Get "right" vector in plane
                    // 3. Sort vertices using Graham-like method
                Severity: Major
                Found in packages/miew/src/gfx/VolumeMesh.js - About 2 hrs to fix

                  Function getMiewWithCli has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var getMiewWithCli = function getMiewWithCli(miewInstance) {
                    var obj = Object.create(miewInstance);
                    obj.script = function (script, _printCallback, _errorCallback) {
                      MiewCLIParser.parser.yy.miew = obj;
                      MiewCLIParser.parser.yy.echo = _printCallback;
                  Severity: Major
                  Found in packages/miew-cli/dist/index.modern.js - About 2 hrs to fix

                    Function test_match has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          test_match: function test_match(match, indexed_rule) {
                            var token, lines, backup;
                            if (this.options.backtrack_lexer) {
                              backup = {
                                yylineno: this.yylineno,
                    Severity: Major
                    Found in packages/miew-cli/dist/index.js - About 2 hrs to fix

                      Function getMiewWithCli has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var getMiewWithCli = function getMiewWithCli(miewInstance) {
                        var obj = Object.create(miewInstance);
                        obj.script = function (script, _printCallback, _errorCallback) {
                          MiewCLIParser.parser.yy.miew = obj;
                          MiewCLIParser.parser.yy.echo = _printCallback;
                      Severity: Major
                      Found in packages/miew-cli/dist/index.js - About 2 hrs to fix

                        Function test_match has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              test_match: function test_match(match, indexed_rule) {
                                var token, lines, backup;
                                if (this.options.backtrack_lexer) {
                                  backup = {
                                    yylineno: this.yylineno,
                        Severity: Major
                        Found in packages/miew-cli/dist/index.modern.js - About 2 hrs to fix

                          Function Menu has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function Menu(/** Node */ container, /** Miew */ viewer) {
                            // Add proper DOM elements
                            _.forEach($.parseHTML(menuHtml), (element) =>
                              container.parentNode.appendChild(element)
                            )
                          Severity: Major
                          Found in demo/src/scripts/ui/Menu.js - About 2 hrs to fix

                            Function _parseAssemblyInfo has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              _parseAssemblyInfo(mmtfData) {
                                let i
                                let j
                                let k
                                const assemblies = []
                            Severity: Major
                            Found in packages/miew/src/io/parsers/MMTFParser.js - About 2 hrs to fix

                              Function _renderFrame has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                _renderFrame(stereo) {
                                  const gfx = this._gfx
                                  const { renderer } = gfx
                              
                                  renderer.getSize(this._size)
                              Severity: Major
                              Found in packages/miew/src/Miew.ts - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language