Showing 665 of 665 total issues

Similar blocks of code found in 8 locations. Consider refactoring.
Open

      for (let i = 0; i < 4; i++) {
        handle = new WidgetsHandle(targetMesh, controls, params);
        this.add(handle);
        this._handles.push(handle);
      }
Severity: Major
Found in src/widgets/widgets.biruler.js and 7 other locations - About 1 hr to fix
src/widgets/widgets.angle.js on lines 43..47
src/widgets/widgets.annotation.js on lines 49..53
src/widgets/widgets.crossRuler.js on lines 50..54
src/widgets/widgets.ellipse.js on lines 49..53
src/widgets/widgets.pressureHalfTime.js on lines 58..62
src/widgets/widgets.rectangle.js on lines 48..52
src/widgets/widgets.ruler.js on lines 43..47

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  constructor() {
    super();
    this.name = 'interpolationTrilinear';

    // default properties names
src/shaders/helpers/shaders.helpers.texture3d.js on lines 4..12

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      const rowX = [
        -this._dataSet.affine[0][0],
        -this._dataSet.affine[0][1],
        this._dataSet.affine[0][2],
      ];
Severity: Major
Found in src/parsers/parsers.nifti.js and 1 other location - About 1 hr to fix
src/parsers/parsers.nifti.js on lines 218..222

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  constructor() {
    super();
    this.name = 'texture3d';

    // default properties names
Severity: Major
Found in src/shaders/helpers/shaders.helpers.texture3d.js and 1 other location - About 1 hr to fix
src/shaders/interpolation/shaders.interpolation.trilinear.js on lines 5..13

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      const rowY = [
        -this._dataSet.affine[1][0],
        -this._dataSet.affine[1][1],
        this._dataSet.affine[0][2],
      ];
Severity: Major
Found in src/parsers/parsers.nifti.js and 1 other location - About 1 hr to fix
src/parsers/parsers.nifti.js on lines 213..217

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Consider simplifying this complex logical expression.
Open

    if (
      !(
        super.validate(model) &&
        typeof model.mergeSeries === 'function' &&
        model.hasOwnProperty('_seriesInstanceUID') &&
Severity: Critical
Found in src/models/models.series.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

        if (
          this._stackID === stack.stackID &&
          this._numberOfFrames === 1 &&
          stack._numberOfFrames === 1 &&
          this._frame[0].columns === stack.frame[0].columns &&
    Severity: Critical
    Found in src/models/models.stack.js - About 1 hr to fix

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

        _reorderData() {
          let numberOfChannels = this.numberOfChannels();
          let numPixels = this.rows() * this.columns() * numberOfChannels;
          let buffer = this._niftiImage;
      
      
      Severity: Minor
      Found in src/parsers/parsers.nifti.js - About 1 hr to fix

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

          _decodePixelData(frameIndex = 0) {
            // if compressed..?
            let transferSyntaxUID = this.transferSyntaxUID();
        
            // find compression scheme
        Severity: Minor
        Found in src/parsers/parsers.dicom.js - About 1 hr to fix

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

            static orderIntersections(points, direction) {
              let reference = this.centerOfMass(points);
              // direction from first point to reference
              let referenceDirection = new Vector3(
                points[0].x - reference.x,
          Severity: Minor
          Found in src/core/core.utils.js - About 1 hr to fix

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

                updateDOM() {
                  this.updateDOMColor();
            
                  // update line
                  const lineData = this.getLineData(
            Severity: Minor
            Found in src/widgets/widgets.ruler.js - About 1 hr to fix

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

                  onEnd() {
                    this._handles[0].onEnd();
                    this._handles[2].onEnd();
                    this._handles[3].onEnd();
              
              
              Severity: Minor
              Found in src/widgets/widgets.crossRuler.js - About 1 hr to fix

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    const y = new Vector3(
                      this._dataSet.spaceDirections[1][0],
                      this._dataSet.spaceDirections[1][1],
                      this._dataSet.spaceDirections[1][2]
                    );
                Severity: Major
                Found in src/parsers/parsers.nrrd.js and 2 other locations - About 1 hr to fix
                src/parsers/parsers.nrrd.js on lines 174..178
                src/parsers/parsers.nrrd.js on lines 186..190

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 61.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    const z = new Vector3(
                      this._dataSet.spaceDirections[2][0],
                      this._dataSet.spaceDirections[2][1],
                      this._dataSet.spaceDirections[2][2]
                    );
                Severity: Major
                Found in src/parsers/parsers.nrrd.js and 2 other locations - About 1 hr to fix
                src/parsers/parsers.nrrd.js on lines 174..178
                src/parsers/parsers.nrrd.js on lines 180..184

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 61.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    const x = new Vector3(
                      this._dataSet.spaceDirections[0][0],
                      this._dataSet.spaceDirections[0][1],
                      this._dataSet.spaceDirections[0][2]
                    );
                Severity: Major
                Found in src/parsers/parsers.nrrd.js and 2 other locations - About 1 hr to fix
                src/parsers/parsers.nrrd.js on lines 180..184
                src/parsers/parsers.nrrd.js on lines 186..190

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 61.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Function constructor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  constructor() {
                    super();
                
                    this._sopInstanceUID = null;
                    this._url = null;
                Severity: Minor
                Found in src/models/models.frame.js - About 1 hr to fix

                  Function updateDOMContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      updateDOMContent(clear) {
                        const vMaxContainer = this._label.querySelector('.vmax');
                        const vMeanContainer = this._label.querySelector('.vmean');
                        const gMaxContainer = this._label.querySelector('.gmax');
                        const gMeanContainer = this._label.querySelector('.gmean');
                  Severity: Minor
                  Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

                    Function constructor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        constructor(targetMesh, controls, params = {}) {
                          super(targetMesh, controls, params);
                    
                          this._widgetType = 'PeakVelocity';
                    
                    
                    Severity: Minor
                    Found in src/widgets/widgets.peakVelocity.js - About 1 hr to fix

                      Function constructor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          constructor(targetMesh, controls, params = {}) {
                            super(targetMesh, controls, params);
                      
                            this._widgetType = 'Angle';
                      
                      
                      Severity: Minor
                      Found in src/widgets/widgets.angle.js - About 1 hr to fix

                        Function merge has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          merge(series) {
                            if (!this.validate(series)) {
                              return false;
                            }
                        
                        
                        Severity: Minor
                        Found in src/models/models.series.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

                        Severity
                        Category
                        Status
                        Source
                        Language