Showing 711 of 1,553 total issues

Avoid too many return statements within this function.
Open

      if (r >= -128) return i.setUint8(o, 208), i.setInt8(o + 1, r), 2
Severity: Major
Found in packages/miew/src/vendors/mmtf.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          if (r >= -128) return 2
    Severity: Major
    Found in packages/miew/src/vendors/mmtf.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return 0
      Severity: Major
      Found in packages/miew/src/gfx/VolumeMesh.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                if (256 > r) return i.setUint8(o, 204), i.setUint8(o + 1, r), 2
        Severity: Major
        Found in packages/miew/src/vendors/mmtf.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                if (r >= -32768) return 3
          Severity: Major
          Found in packages/miew/src/vendors/mmtf.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return 0
            Severity: Major
            Found in packages/miew/src/gfx/VolumeMesh.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return 0
              Severity: Major
              Found in packages/miew/src/gfx/VolumeMesh.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      if (r >= -2147483648) return i.setUint8(o, 210), i.setInt32(o + 1, r), 5
                Severity: Major
                Found in packages/miew/src/vendors/mmtf.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        if (4294967296 > e) return 5 + o
                  Severity: Major
                  Found in packages/miew/src/vendors/mmtf.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          if (r >= -32768) return i.setUint8(o, 209), i.setInt16(o + 1, r), 3
                    Severity: Major
                    Found in packages/miew/src/vendors/mmtf.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return i.setUint8(o, 203), i.setFloat64(o + 1, r), 9
                      Severity: Major
                      Found in packages/miew/src/vendors/mmtf.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                  return false
                        Severity: Major
                        Found in packages/miew/src/utils/SelectionParser.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return val
                          Severity: Major
                          Found in packages/miew/src/io/parsers/readCIF.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                      return this.EOF
                            Severity: Major
                            Found in packages/miew/src/utils/SelectionParser.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                        return false
                              Severity: Major
                              Found in packages/miew/src/options.test.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                          return this.parseError(
                                            'Lexical error on line ' +
                                              (this.yylineno + 1) +
                                              '. Unrecognized text.\n' +
                                              this.showPosition(),
                                Severity: Major
                                Found in packages/miew/src/utils/SelectionParser.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return true
                                  Severity: Major
                                  Found in packages/miew/src/options.test.js - About 30 mins to fix

                                    Function hash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      version.hash = (function () {
                                        function stdout(cmd) {
                                          return cmd.stdout === null ? 'nogit' : String(cmd.stdout).trim()
                                        }
                                    
                                    
                                    Severity: Minor
                                    Found in packages/miew-cli/tools/version.js - About 25 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 shotDownload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function shotDownload(dataUrl, filename) {
                                      if (!dataUrl || dataUrl.substr(0, 5) !== 'data:') {
                                        return;
                                      }
                                      if (!filename) {
                                    Severity: Minor
                                    Found in packages/miew-cli/dist/index.modern.js - About 25 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 shotDownload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function shotDownload(dataUrl, filename) {
                                      if (!dataUrl || dataUrl.substr(0, 5) !== 'data:') {
                                        return
                                      }
                                      if (!filename) {
                                    Severity: Minor
                                    Found in packages/miew-cli/src/utils.js - About 25 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language