Showing 711 of 1,553 total issues

Function lexer has 405 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var lexer = (function () {
    var lexer = {
      EOF: 1,

      parseError: function parseError(str, hash) {
Severity: Major
Found in packages/miew/src/utils/SelectionParser.js - About 2 days to fix

    Function _addReprListItem has 371 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      File SelectionParser.js has 785 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable */
      // DO NOT EDIT! Automatically generated from .jison
      /* parser generated by jison 0.4.18 */
      /*
        Returns a Parser object of the following structure:
      Severity: Major
      Found in packages/miew/src/utils/SelectionParser.js - About 1 day to fix

        File mmtf.js has 771 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        !(function (r, t) {
          if ('function' == typeof define && define.amd) define(['exports'], t)
          else if ('object' == typeof exports && 'undefined' != typeof module)
            t(exports)
          else t((r.MMTF = r.MMTF || {}))
        Severity: Major
        Found in packages/miew/src/vendors/mmtf.js - About 1 day to fix

          File Complex.js has 755 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import logger from '../utils/logger'
          import Atom from './Atom'
          import Chain from './Chain'
          import Helix from './Helix'
          import Strand from './Strand'
          Severity: Major
          Found in packages/miew/src/chem/Complex.js - About 1 day to fix

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

                performAction: function anonymous(
                  yytext,
                  yyleng,
                  yylineno,
                  yy,
            Severity: Major
            Found in packages/miew-cli/src/MiewCLIParser.js - About 1 day to fix

              File ObjectControls.js has 729 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import Timer from '../Timer'
              import settings from '../settings'
              import EventDispatcher from '../utils/EventDispatcher'
              import { Matrix4, Quaternion, Vector2, Vector3 } from 'three'
              
              
              Severity: Major
              Found in packages/miew/src/ui/ObjectControls.js - About 1 day to fix

                Function CLIUtils has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
                Open

                var CLIUtils = function () {
                  function CLIUtils() {
                    _classCallCheck(this, CLIUtils);
                  }
                  _createClass(CLIUtils, [{
                Severity: Minor
                Found in packages/miew-cli/dist/index.modern.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 CLIUtils has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
                Open

                var CLIUtils = function () {
                  function CLIUtils() {
                    _classCallCheck(this, CLIUtils);
                  }
                  _createClass(CLIUtils, [{
                Severity: Minor
                Found in packages/miew-cli/dist/index.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

                File SSIsosurfaceGeometry.js has 721 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import IsoSurfaceGeometry from './IsoSurfaceGeometry'
                import IsoSurfaceAtomColored from './IsoSurfaceAtomColored'
                import IsosurfaceBuildNormals from './IsosurfaceBuildNormals'
                import IsoSurfaceMarchCube from './IsoSurfaceMarchCube'
                import IsoSurfaceGeo from './IsoSurfaceGeo'
                Severity: Major
                Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 1 day to fix

                  File ComplexVisual.js has 709 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import utils from './utils'
                  import logger from './utils/logger'
                  import chem from './chem'
                  import settings from './settings'
                  import gfxutils from './gfx/gfxutils'
                  Severity: Major
                  Found in packages/miew/src/ComplexVisual.js - About 1 day to fix

                    Function ContactSurface has 324 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function ContactSurface(packedArrays, boundaries, params, _indexList) {
                      // Field generation method adapted from AstexViewer (Mike Hartshorn)
                      // by Fred Ludlow.
                      // Other parts based heavily on NGL (Alexander Rose) EDT Surface class
                      //
                    Severity: Major
                    Found in packages/miew/src/gfx/geometries/ContactSurface.js - About 1 day to fix

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

                          performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate
                          , $$
                          , _$
                          ) {
                            var $0 = $$.length - 1;
                      Severity: Major
                      Found in packages/miew-cli/dist/index.modern.js - About 1 day to fix

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

                            performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate
                            , $$
                            , _$
                            ) {
                              var $0 = $$.length - 1;
                        Severity: Major
                        Found in packages/miew-cli/dist/index.js - About 1 day to fix

                          Function _buildAlphaHelices has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
                          Open

                            _buildAlphaHelices(inResidues, chainLength, inPreferPiHelices) {
                              // Helix and Turn
                              for (let stride = 3; stride <= 5; ++stride) {
                                if (inResidues.length < stride) {
                                  break
                          Severity: Minor
                          Found in packages/miew/src/chem/SecondaryStructureMap.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 process_file has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def process_file(filename):
                            print 'Processing %s...' % filename
                            stats = defaultdict(int)
                            stats_props = defaultdict(set)
                            with open(filename) as f:
                          Severity: Minor
                          Found in demo/tools/pdbfreq.py - 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 process_file has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def process_file(filename):
                            print 'Processing %s...' % filename
                            stats = defaultdict(int)
                            stats_props = defaultdict(set)
                            with open(filename) as f:
                          Severity: Minor
                          Found in packages/miew/tools/pdbfreq.py - 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

                          File CMLParser.js has 631 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import Parser from './Parser'
                          import chem from '../../chem'
                          import { isString } from 'lodash'
                          import { Vector3 } from 'three'
                          
                          
                          Severity: Major
                          Found in packages/miew/src/io/parsers/CMLParser.js - About 1 day to fix

                            Function readCIF has 256 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function readCIF(source) {
                              let i = 0
                              let j = 0
                              const n = source.length
                              let code = NaN
                            Severity: Major
                            Found in packages/miew/src/io/parsers/readCIF.js - About 1 day to fix

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

                                    performAction: function anonymous(
                                      yy,
                                      yy_,
                                      $avoiding_name_collisions,
                                      YY_START
                              Severity: Major
                              Found in packages/miew-cli/src/MiewCLIParser.js - About 1 day to fix
                                Severity
                                Category
                                Status
                                Source
                                Language