ivmartel/dwv

View on GitHub

Showing 209 of 401 total issues

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

          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 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/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 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 update has a Cognitive Complexity of 6 (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/arrow.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

          Severity
          Category
          Status
          Source
          Language