ivmartel/dwv

View on GitHub

Showing 218 of 386 total issues

Function LayerResolutionComponentPositionIterator has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function LayerResolutionComponentPositionIterator(context) {
    var siz = context.SIZ;
    var tileIndex = context.currentTile.index;
    var tile = context.tiles[tileIndex];
    var layersCount = tile.codingStyleDefaultParameters.layersCount;
Severity: Minor
Found in decoders/pdfjs/jpx.js - About 1 hr to fix

    Function BitModel_runMagnitudeRefinementPass has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function BitModel_runMagnitudeRefinementPass() {
            var decoder = this.decoder;
            var width = this.width, height = this.height;
            var coefficentsMagnitude = this.coefficentsMagnitude;
            var neighborsSignificance = this.neighborsSignificance;
    Severity: Minor
    Found in decoders/pdfjs/jpx.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 JpxImage_nextPacket has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.nextPacket = function JpxImage_nextPacket() {
              // Section B.12.1.5 Component-position-resolution-layer
              for (; c < componentsCount; ++c) {
                var component = tile.components[c];
                var precinctsIterationSizes = precinctsSizes.components[c];
        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 JpxImage_nextPacket has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.nextPacket = function JpxImage_nextPacket() {
                  // Section B.12.1.4 Position-component-resolution-layer
                  for (; py < precinctsIterationSizes.maxNumHigh; py++) {
                    for (; px < precinctsIterationSizes.maxNumWide; px++) {
                      for (; c < componentsCount; c++) {
            Severity: Minor
            Found in decoders/pdfjs/jpx.js - About 1 hr to fix

              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 getScoordFromShape has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                export function getScoordFromShape(shape) {
                  const scoord = new SpatialCoordinate();
                
                  if (shape instanceof Point2D) {
                    scoord.graphicData = [
                Severity: Minor
                Found in src/dicom/dicomSpatialCoordinate.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 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 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 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 isEqualSegmentFrameInfo has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function isEqualSegmentFrameInfo(dsfi1, dsfi2) {
                          // basics
                          if (typeof dsfi1 === 'undefined' ||
                            typeof dsfi2 === 'undefined' ||
                            dsfi1 === null ||
                        Severity: Minor
                        Found in src/dicom/dicomSegmentFrameInfo.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 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 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 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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language