ivmartel/dwv

View on GitHub

Showing 218 of 386 total issues

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

  video, onloaditem, onload, onprogress, onloadend,
  origin, dataIndex) {
Severity: Major
Found in src/image/domReader.js - About 50 mins to fix

    Avoid deeply nested control flow statements.
    Open

              if (typeof sourceImageSq[j][TagKeys.ReferencedSOPInstanceUID] !==
                'undefined') {
                sourceImage.referencedSOPInstanceUID =
                  sourceImageSq[j][TagKeys.ReferencedSOPInstanceUID].value[0];
              }
    Severity: Major
    Found in src/dicom/dicomSegmentFrameInfo.js - About 45 mins to fix

      Function getDefaultImage has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        width, height, sliceIndex,
        imageBuffer, numberOfFrames,
        imageUid) {
      Severity: Minor
      Found in src/image/domReader.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  if (typeof sourceImageSq[j][TagKeys.ReferencedSOPClassUID] !==
                    'undefined') {
                    sourceImage.referencedSOPClassUID =
                      sourceImageSq[j][TagKeys.ReferencedSOPClassUID].value[0];
                  }
        Severity: Major
        Found in src/dicom/dicomSegmentFrameInfo.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if (Array.isArray(subValue1)) {
                      // merged object with repeated value
                      // copy it with the index list
                      value[valueKey] = {};
                      for (let j = 0; j < id1.length; ++j) {
          Severity: Major
          Found in src/utils/operator.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if (typeof value[valueKey] === 'undefined') {
                        value[valueKey] = {};
                      }
            Severity: Major
            Found in src/utils/operator.js - About 45 mins to fix

              Function decode has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              dwvdecoder.RleDecoder.prototype.decode = function (buffer,
                bitsAllocated, isSigned, sliceSize, samplesPerPixel, planarConfiguration) {
              Severity: Minor
              Found in decoders/dwv/rle.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                      if (dirMax0.index === 0) {
                        // xzy
                        rangeObj = getRange(dataAccessor,
                          start, maxIter, 1, ncols, sliceSize, reverse1, reverse2);
                      } else {
                Severity: Major
                Found in src/image/iterator.js - About 45 mins to fix

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

                  export function getDicomSegmentItem(segment) {
                    let algoType = segment.algorithmType;
                    if (algoType === undefined) {
                      algoType = 'MANUAL';
                    }
                  Severity: Minor
                  Found in src/dicom/dicomSegment.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 getViewFromDOMVideo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function getViewFromDOMVideo(
                    video, onloaditem, onload, onprogress, onloadend,
                    origin, dataIndex) {
                    // video size
                    const width = video.videoWidth;
                  Severity: Minor
                  Found in src/image/domReader.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

                          for (var j = 0; j < -count + 1; ++j) {
                            // store
                            outputArray[outputIndex] = value;
                            // increment index
                            outputIndex += outputIndexIncrement;
                  Severity: Major
                  Found in decoders/dwv/rle.js - About 45 mins to fix

                    Function rangeRegion has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      dataAccessor, start, end, increment, regionSize, regionOffset) {
                    Severity: Minor
                    Found in src/image/iterator.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if (gotOneArg) {
                                  baseUrl += '&';
                                }
                      Severity: Major
                      Found in src/utils/uri.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                            if (!isClosed) {
                              if (points.length === 2) {
                                shape = new Line(points[0], points[1]);
                              } else if (points.length === 3) {
                                shape = new Protractor([points[0], points[1], points[2]]);
                        Severity: Major
                        Found in src/dicom/dicomSpatialCoordinate.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                  if (dicomElement.vr === 'OB') {
                                    tmp = '00'.substring(0, 2 - tmp.length) + tmp;
                                  } else {
                                    tmp = '0000'.substring(0, 4 - tmp.length) + tmp;
                                  }
                          Severity: Major
                          Found in src/dicom/dicomElementsWrapper.js - About 45 mins to fix

                            Function PageViewport has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) {
                            Severity: Minor
                            Found in decoders/pdfjs/util.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          if (readBits(1)) {
                                            valueReady = !zeroBitPlanesTree.nextLevel();
                                            if (valueReady) {
                                              break;
                                            }
                              Severity: Major
                              Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                              for (b = 0; b < numBuffers; b++) {
                                                colBuffers[b][l] = items[k + b];
                                              }
                                Severity: Major
                                Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                } else if ((quantizationTableSpec >> 4) === 1) { //16 bit
                                                  for (j = 0; j < 64; j++) {
                                                    z = dctZigZag[j];
                                                    tableData[z] = readUint16();
                                                  }
                                  Severity: Major
                                  Found in decoders/pdfjs/jpg.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                if (reversible && (nb >= mb)) {
                                                  coefficients[pos] = n;
                                                } else {
                                                  coefficients[pos] = n * (1 << (mb - nb));
                                                }
                                    Severity: Major
                                    Found in decoders/pdfjs/jpx.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language