ivmartel/dwv

View on GitHub

Showing 218 of 386 total issues

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 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 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 getSuvFactor has a Cognitive Complexity of 7 (exceeds 5 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 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 (0xFF00 | this.marker) << 8;
      Severity: Major
      Found in decoders/rii-mango/lossless.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return (0xFF00 | this.marker) << 8;
        Severity: Major
        Found in decoders/rii-mango/lossless.js - About 30 mins to fix

          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 this._convertCmykToRgb(data);
            Severity: Major
            Found in decoders/pdfjs/jpg.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

                Avoid too many return statements within this function.
                Open

                      return data;
                Severity: Major
                Found in decoders/pdfjs/jpg.js - About 30 mins to fix

                  Function dcmdump has a Cognitive Complexity of 6 (exceeds 5 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 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 simpleRange3d has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function simpleRange3d(
                    dataAccessor, start, end, increment, isPlanar) {
                    if (typeof increment === 'undefined') {
                      increment = 1;
                    }
                  Severity: Minor
                  Found in src/image/iterator.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 getRegionSliceIterator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function getRegionSliceIterator(
                    image, index, isRescaled, min, max) {
                    if (image.getNumberOfComponents() !== 1) {
                      throw new Error('Unsupported number of components for region iterator: ' +
                        image.getNumberOfComponents());
                  Severity: Minor
                  Found in src/image/iterator.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 isEqualSegmentFrameInfo has a Cognitive Complexity of 6 (exceeds 5 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 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 getDicomSegmentFrameInfoItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function getDicomSegmentFrameInfoItem(frameInfo) {
                    const item = {
                      FrameContentSequence: {
                        value: [
                          {
                  Severity: Minor
                  Found in src/dicom/dicomSegmentFrameInfo.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 getTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function getTime(element) {
                    if (typeof element === 'undefined') {
                      return undefined;
                    }
                    if (element.value.length !== 1) {
                  Severity: Minor
                  Found in src/dicom/dicomDate.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 toString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    toString(prefix) {
                      if (typeof prefix === 'undefined') {
                        prefix = '';
                      }
                  
                  
                  Severity: Minor
                  Found in src/dicom/dicomSRContent.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