ivmartel/dwv

View on GitHub

Showing 209 of 399 total issues

Avoid deeply nested control flow statements.
Open

            for (pos = c, j = 0, jj = items.length; j < jj; j++) {
              val = items[j];
              out[pos] = val <= min ? 0 :
                         val >= max ? 255 : (val + offset) >> shift;
              pos += componentsCount;
Severity: Major
Found in decoders/pdfjs/jpx.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if(isSigned){
                  shift = 0;
                  offset = 0;
                }else{
                  shift = components[c].precision - 8;
    Severity: Major
    Found in decoders/pdfjs/jpx.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if ((value >> 4) === 0) {
                              break;
                          }
      Severity: Major
      Found in decoders/rii-mango/lossless.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

                      while (true) {
                        if (readBits(1)) {
                          valueReady = !inclusionTree.nextLevel();
                          if (valueReady) {
                            codeblock.included = true;
          Severity: Major
          Found in decoders/pdfjs/jpx.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        for (pos = c, j = 0, jj = items.length; j < jj; j++) {
                          val = items[j];
                          out[pos] = (val + offset);
                          pos += componentsCount;
                        }
            Severity: Major
            Found in decoders/pdfjs/jpx.js - About 45 mins to fix

              Function simpleRange3d has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

                Function getRegionSliceIterator has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  image, index, isRescaled, min, max) {
                Severity: Minor
                Found in src/image/iterator.js - About 35 mins to fix

                  Function getPrecinctIndexIfExist has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) {
                  Severity: Minor
                  Found in decoders/pdfjs/jpx.js - About 35 mins to fix

                    Function generateImageDataPaletteColor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      array,
                      iterator,
                      alphaFunc,
                      colourMap,
                      is16BitsStored) {
                    Severity: Minor
                    Found in src/image/viewPaletteColor.js - About 35 mins to fix

                      Function generateImageDataMonochrome has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        array,
                        iterator,
                        alphaFunc,
                        windowLut,
                        colourMap) {
                      Severity: Minor
                      Found in src/image/viewMonochrome.js - About 35 mins to fix

                        Function rangeRegions has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

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

                          Function BitModel has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              function BitModel(width, height, subband, zeroBitPlanes, mb) {
                          Severity: Minor
                          Found in decoders/pdfjs/jpx.js - About 35 mins to fix

                            Function decodeMcu has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                function decodeMcu(component, decode, mcu, row, col) {
                            Severity: Minor
                            Found in decoders/pdfjs/jpg.js - About 35 mins to fix

                              Function create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                create(points, style, viewController) {
                                  // physical shape
                                  const line0 = new Line(points[0], points[1]);
                                  // points stored the Konvajs way
                                  const pointsArray = [];
                              Severity: Minor
                              Found in src/tools/protractor.js - About 35 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 update has a Cognitive Complexity of 7 (exceeds 5 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/ruler.js - About 35 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 arrayContains has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function arrayContains(arr0, arr1) {
                                // check input
                                if (arr0 === null ||
                                  arr1 === null ||
                                  typeof arr0 === 'undefined' ||
                              Severity: Minor
                              Found in src/utils/array.js - About 35 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 getFileExtension has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function getFileExtension(filePath) {
                                let ext = null;
                                if (typeof filePath !== 'undefined' &&
                                  filePath !== null &&
                                  filePath[0] !== '.') {
                              Severity: Minor
                              Found in src/utils/string.js - About 35 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 too many return statements within this function.
                              Open

                                    return value + 37;
                              Severity: Major
                              Found in decoders/pdfjs/jpx.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return result;
                                Severity: Major
                                Found in decoders/rii-mango/lossless.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language