Showing 711 of 1,553 total issues

Function _extractAssemblies has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  _extractAssemblies(complex, complexData) {
    const { asymDict } = this
    const asmGen = complexData.pdbx_struct_assembly_gen
    if (!asmGen) {
      return
Severity: Minor
Found in packages/miew/src/io/parsers/CIFParser.js - About 55 mins 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 performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate
    , $$
    , _$
Severity: Major
Found in packages/miew-cli/dist/index.js - About 50 mins to fix

    Function performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate
        , $$
        , _$
    Severity: Major
    Found in packages/miew-cli/dist/index.modern.js - About 50 mins to fix

      Function performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            yytext,
            yyleng,
            yylineno,
            yy,
            yystate /* action[1] */,
      Severity: Major
      Found in packages/miew-cli/src/MiewCLIParser.js - About 50 mins to fix

        Function performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              yytext,
              yyleng,
              yylineno,
              yy,
              yystate /* action[1] */,
        Severity: Major
        Found in packages/miew/src/utils/SelectionParser.js - About 50 mins to fix

          Function compareOptionsWithDefaults has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function compareOptionsWithDefaults(opts, defOpts) {
            var optsStr = [];
            if (defOpts && opts) {
              var keys = Object.keys(opts);
              for (var p = 0; p < keys.length; ++p) {
          Severity: Minor
          Found in packages/miew-cli/dist/index.js - About 45 mins 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 compareOptionsWithDefaults has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function compareOptionsWithDefaults(opts, defOpts) {
            const optsStr = []
            if (defOpts && opts) {
              const keys = Object.keys(opts)
              for (let p = 0; p < keys.length; ++p) {
          Severity: Minor
          Found in packages/miew-cli/src/utils.js - About 45 mins 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 remove has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            remove(index) {
              if (index && Object.hasOwn(this.representationID, index)) {
                delete this.representationMap[this.representationID[index]]
                delete this.representationID[index]
              }
          Severity: Minor
          Found in packages/miew-cli/src/Miew-cli.js - About 45 mins 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 _updateInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          Menu.prototype._updateInfo = function (dataSource) {
            if (dataSource && dataSource.id !== 'Complex') {
              return
            }
            const complex = dataSource
          Severity: Minor
          Found in demo/src/scripts/ui/Menu.js - About 45 mins 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 isNativeReflectConstruct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          var isNativeReflectConstruct = createCommonjsModule(function (module) {
          function _isNativeReflectConstruct() {
            if (typeof Reflect === "undefined" || !Reflect.construct) return false;
            if (Reflect.construct.sham) return false;
            if (typeof Proxy === "function") return true;
          Severity: Minor
          Found in packages/miew-cli/dist/index.modern.js - About 45 mins 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 compareOptionsWithDefaults has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function compareOptionsWithDefaults(opts, defOpts) {
            var optsStr = [];
            if (defOpts && opts) {
              var keys = Object.keys(opts);
              for (var p = 0; p < keys.length; ++p) {
          Severity: Minor
          Found in packages/miew-cli/dist/index.modern.js - About 45 mins 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 _fixKeyboard has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          Menu.prototype._fixKeyboard = function () {
            // do IFRAME related hack
            if (window !== window.top) {
              const parentDocument = window.top.document
              let button = parentDocument.querySelector('button')
          Severity: Minor
          Found in demo/src/scripts/ui/Menu.js - About 45 mins 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 isNativeReflectConstruct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          var isNativeReflectConstruct = createCommonjsModule(function (module) {
          function _isNativeReflectConstruct() {
            if (typeof Reflect === "undefined" || !Reflect.construct) return false;
            if (Reflect.construct.sham) return false;
            if (typeof Proxy === "function") return true;
          Severity: Minor
          Found in packages/miew-cli/dist/index.js - About 45 mins 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 setFrame has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            setFrame(frameIdx) {
              this.frameIsReady = false
              if (
                frameIdx >= this._framesRange.start &&
                frameIdx <= this._framesRange.end
          Severity: Minor
          Found in packages/miew/src/gfx/FrameInfo.js - About 45 mins 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 _prepareCylinderInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function _prepareCylinderInfo(chunkIndices) {
            chunkIndices.sort(sortNumber)
            const chunksIdx = []
            const cylinderInfo = []
            for (let i = 0, n = chunkIndices.length; i < n; ++i) {
          Severity: Minor
          Found in packages/miew/src/gfx/geometries/Instanced2CCylindersGeometry.js - About 45 mins 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 getAtomColor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            getAtomColor(atom, _complex) {
              const { opts } = this
              let factor = 1
              if (atom.temperature && opts) {
                if (opts.min === opts.max) {
          Severity: Minor
          Found in packages/miew/src/gfx/colorers/TemperatureColorer.js - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                      if (cube.pointsValuesLinear[cubeValuesIndex + i] < 0.0) {
                        bitsInside |= 1 << i
                      }
          Severity: Major
          Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (val < corners[ind]) {
                          corners[ind] = val
                        }
            Severity: Major
            Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 45 mins to fix

              Function _build has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                _build() {
                  const bondsIdc = this._selection.chunks
                  const { bonds, parent } = this._selection
                  const mode = this._mode
                  const colorer = this._colorer
              Severity: Minor
              Found in packages/miew/src/gfx/modes/groups/BondsCylinderGroup.js - About 45 mins 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

              Avoid deeply nested control flow statements.
              Open

                          if (dist2 < probeSpRad2) {
                            distToSphere = Math.sqrt(dist2)
                            distToBorder = -(distToSphere - probeSphereRadius)
                            innerBlockWorkAround()
                          } // if (dist from corner point to sphere center more 2 radiuses)
              Severity: Major
              Found in packages/miew/src/gfx/geometries/SSIsosurfaceGeometry.js - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language