ivmartel/dwv

View on GitHub

Showing 209 of 399 total issues

Function BitModel_setNeighborsSignificance has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function BitModel_setNeighborsSignificance(row, column, index) {
        var neighborsSignificance = this.neighborsSignificance;
        var width = this.width, height = this.height;
        var left = (column > 0);
        var right = (column + 1 < width);
Severity: Minor
Found in decoders/pdfjs/jpx.js - About 1 hr to fix

    Function decodeManifest has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function decodeManifest(manifest, nslices) {
      const result = [];
      // wado url
      const wadoElement = manifest.getElementsByTagName('wado_query');
      const wadoURL = wadoElement[0].getAttribute('wadoURL');
    Severity: Minor
    Found in src/utils/uri.js - About 1 hr to fix

      Function runHandlers has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          runHandlers: function runHandlers() {
            var RUN_TIMEOUT = 1; // ms
            var timeoutAt = Date.now() + RUN_TIMEOUT;
            while (this.handlers.length > 0) {
              var handler = this.handlers.shift();
      Severity: Minor
      Found in decoders/pdfjs/util.js - About 1 hr to fix

        Function combineUrl has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        function combineUrl(baseUrl, url) {
          if (!url) {
            return baseUrl;
          }
          if (/^[a-z][a-z0-9+\-.]*:/i.test(url)) {
        Severity: Minor
        Found in decoders/pdfjs/util.js - About 1 hr 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 splitKeyValueString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export function splitKeyValueString(inputStr) {
          // result
          const result = {};
          // check input string
          if (inputStr) {
        Severity: Minor
        Found in src/utils/string.js - About 1 hr 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 getVectorStringLPS has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        function getVectorStringLPS(vector) {
          let abs = new Vector3D(
            Math.abs(vector.getX()),
            Math.abs(vector.getY()),
            Math.abs(vector.getZ())
        Severity: Minor
        Found in src/math/orientation.js - About 1 hr 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 update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          update(anchor, style, _viewController) {
            // parent group
            const group = anchor.getParent();
            // associated shape
            const kroi = group.getChildren(function (node) {
        Severity: Minor
        Found in src/tools/roi.js - About 1 hr to fix

          Function update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            update(anchor, style, _viewController) {
              // parent group
              const group = anchor.getParent();
              // associated shape
              const kline = group.getChildren(function (node) {
          Severity: Minor
          Found in src/tools/freeHand.js - About 1 hr to fix

            Function getVectorStringLPS has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function getVectorStringLPS(vector) {
              let abs = new Vector3D(
                Math.abs(vector.getX()),
                Math.abs(vector.getY()),
                Math.abs(vector.getZ())
            Severity: Minor
            Found in src/math/orientation.js - About 1 hr to fix

              Function buildHuffTable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              jpeg.lossless.HuffmanTable.prototype.buildHuffTable = function(tab, L, V) {
                  /*jslint bitwise: true */
              
                  var currentTable, temp, k, i, j, n;
                  temp = 256;
              Severity: Minor
              Found in decoders/rii-mango/lossless.js - About 1 hr to fix

                Function getViewFromDOMImage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function getViewFromDOMImage(domImage, origin, index) {
                  // image size
                  const width = domImage.width;
                  const height = domImage.height;
                
                
                Severity: Minor
                Found in src/image/domReader.js - About 1 hr to fix

                  Function rangeRegions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function rangeRegions(
                    dataAccessor, start, end, increment, regions) {
                    let nextIndex = start;
                    let regionCount = 0;
                    let regionElementCount = 0;
                  Severity: Minor
                  Found in src/image/iterator.js - About 1 hr to fix

                    Function isEqualSegment has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function isEqualSegment(seg1, seg2) {
                      // basics
                      if (typeof seg1 === 'undefined' ||
                        typeof seg2 === 'undefined' ||
                        seg1 === null ||
                    Severity: Minor
                    Found in src/dicom/dicomSegment.js - About 1 hr to fix

                      Function dcmdump has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function dcmdump(dicomElements) {
                        const keys = Object.keys(dicomElements);
                        let result = '\n';
                        result += '# Dicom-File-Format\n';
                        result += '\n';
                      Severity: Minor
                      Found in src/dicom/dicomElementsWrapper.js - About 1 hr to fix

                        Function getData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            getData: function getData(width, height, forceRGBoutput) {
                              if (this.numComponents > 4) {
                                throw 'Unsupported color mode';
                              }
                              // type of data: Uint8Array(width * height * numComponents)
                        Severity: Minor
                        Found in decoders/pdfjs/jpg.js - About 1 hr to fix

                          Function read has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          jpeg.lossless.ScanHeader.prototype.read = function(data) {
                              /*jslint bitwise: true */
                          
                              var count = 0, length, i, temp;
                          
                          
                          Severity: Minor
                          Found in decoders/rii-mango/lossless.js - About 1 hr to fix

                            Function buildHuffmanTable has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function buildHuffmanTable(codeLengths, values) {
                                var k = 0, code = [], i, j, length = 16;
                                while (length > 0 && !codeLengths[length - 1]) {
                                  length--;
                                }
                            Severity: Minor
                            Found in decoders/pdfjs/jpg.js - About 1 hr to fix

                              Function range3d has 9 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              export function range3d(dataAccessor, start, maxIter, increment,
                                blockMaxIter, blockIncrement, reverse1, reverse2, isPlanar) {
                              Severity: Major
                              Found in src/image/iterator.js - About 1 hr to fix

                                Function decodeScan has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  function decodeScan(data, offset, frame, components, resetInterval,
                                                      spectralStart, spectralEnd, successivePrev, successive) {
                                Severity: Major
                                Found in decoders/pdfjs/jpg.js - About 1 hr to fix

                                  Function getSuvFactor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function getSuvFactor(elements) {
                                    let warning = '';
                                  
                                    // CorrectedImage (type2): must contain ATTN and DECY
                                    const corrImageTagStr = 'Corrected Image (00280051)';
                                  Severity: Minor
                                  Found in src/dicom/dicomElementsWrapper.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language