konvajs/konva

View on GitHub
src/Util.ts

Summary

Maintainability
F
1 wk
Test Coverage

File Util.ts has 848 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Konva } from './Global';
import { Context } from './Context';
import { IRect, RGB, RGBA, Vector2d } from './types';

/*
Severity: Major
Found in src/Util.ts - About 2 days to fix

    Util has 50 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export const Util = {
      /*
       * cherry-picked utilities from underscore.js
       */
      _isElement(obj: any): obj is Element {
    Severity: Minor
    Found in src/Util.ts - About 7 hrs to fix

      Function _hslColorToRGBA has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

        _hslColorToRGBA(str: string) {
          // Check hsl() format
          if (/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(str)) {
            // Extract h, s, l
            const [_, ...hsl] = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(str)!;
      Severity: Minor
      Found in src/Util.ts - About 2 hrs 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 _hslColorToRGBA has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _hslColorToRGBA(str: string) {
          // Check hsl() format
          if (/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(str)) {
            // Extract h, s, l
            const [_, ...hsl] = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(str)!;
      Severity: Minor
      Found in src/Util.ts - About 2 hrs to fix

        Function _prepareToStringify has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          _prepareToStringify<T>(obj: any): T | null {
            var desc;
        
            obj.visitedByCircularReferenceRemoval = true;
        
        
        Severity: Minor
        Found in src/Util.ts - 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 drawRoundedRectPath has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          drawRoundedRectPath(
            context: Context,
            width: number,
            height: number,
            cornerRadius: number | number[]
        Severity: Minor
        Found in src/Util.ts - About 1 hr to fix

          Function decompose has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            decompose() {
              var a = this.m[0];
              var b = this.m[1];
              var c = this.m[2];
              var d = this.m[3];
          Severity: Minor
          Found in src/Util.ts - About 1 hr to fix

            Function _prepareToStringify has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _prepareToStringify<T>(obj: any): T | null {
                var desc;
            
                obj.visitedByCircularReferenceRemoval = true;
            
            
            Severity: Minor
            Found in src/Util.ts - About 1 hr to fix

              Function _prepareArrayForTween has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _prepareArrayForTween(startArray, endArray, isClosed) {
                  var n,
                    start: Vector2d[] = [],
                    end: Vector2d[] = [];
                  if (startArray.length > endArray.length) {
              Severity: Minor
              Found in src/Util.ts - About 1 hr to fix

                Function decompose has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  decompose() {
                    var a = this.m[0];
                    var b = this.m[1];
                    var c = this.m[2];
                    var d = this.m[3];
                Severity: Minor
                Found in src/Util.ts - About 45 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 _getProjectionToSegment has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  _getProjectionToSegment(x1, y1, x2, y2, x3, y3) {
                Severity: Minor
                Found in src/Util.ts - About 45 mins to fix

                  Function _rgbaColorToRGBA has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    _rgbaColorToRGBA(str: string) {
                      if (str.indexOf('rgba(') === 0) {
                        str = str.match(/rgba\(([^)]+)\)/)![1]!;
                        var parts = str.split(/ *, */).map((n, index) => {
                          if (n.slice(-1) === '%') {
                  Severity: Minor
                  Found in src/Util.ts - About 45 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 _getProjectionToSegment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    _getProjectionToSegment(x1, y1, x2, y2, x3, y3) {
                      var x, y, dist;
                  
                      var pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
                      if (pd2 == 0) {
                  Severity: Minor
                  Found in src/Util.ts - 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 cloneObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    cloneObject<Any>(obj: Any): Any {
                      var retObj: any = {};
                      for (var key in obj) {
                        if (this._isPlainObject(obj[key])) {
                          retObj[key] = this.cloneObject(obj[key]);
                  Severity: Minor
                  Found in src/Util.ts - 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

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

                      if (typeof cornerRadius === 'number') {
                        topLeft =
                          topRight =
                          bottomLeft =
                          bottomRight =
                  Severity: Major
                  Found in src/Util.ts and 1 other location - About 7 hrs to fix
                  src/shapes/Label.ts on lines 215..226

                  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 186.

                  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

                      var dx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4];
                  Severity: Major
                  Found in src/Util.ts and 1 other location - About 1 hr to fix
                  src/Util.ts on lines 170..170

                  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 63.

                  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

                      var dy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5];
                  Severity: Major
                  Found in src/Util.ts and 1 other location - About 1 hr to fix
                  src/Util.ts on lines 169..169

                  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 63.

                  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

                      for (n = 0; n < startArray.length; n += 2) {
                        start.push({
                          x: startArray[n],
                          y: startArray[n + 1],
                        });
                  Severity: Major
                  Found in src/Util.ts and 1 other location - About 1 hr to fix
                  src/Util.ts on lines 921..926

                  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 2 locations. Consider refactoring.
                  Open

                      for (n = 0; n < endArray.length; n += 2) {
                        end.push({
                          x: endArray[n],
                          y: endArray[n + 1],
                        });
                  Severity: Major
                  Found in src/Util.ts and 1 other location - About 1 hr to fix
                  src/Util.ts on lines 915..920

                  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 2 locations. Consider refactoring.
                  Open

                      var m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);
                  Severity: Major
                  Found in src/Util.ts and 1 other location - About 1 hr to fix
                  src/Util.ts on lines 193..193

                  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 55.

                  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

                      var m5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);
                  Severity: Major
                  Found in src/Util.ts and 1 other location - About 1 hr to fix
                  src/Util.ts on lines 192..192

                  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 55.

                  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

                      if (pd2 == 0) {
                        x = x1;
                        y = y1;
                        dist = (x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2);
                      } else {
                  Severity: Major
                  Found in src/Util.ts and 2 other locations - About 55 mins to fix
                  src/Util.ts on lines 861..873
                  src/Util.ts on lines 865..873

                  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 53.

                  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

                        if (u < 0) {
                          x = x1;
                          y = y1;
                          dist = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);
                        } else if (u > 1.0) {
                  Severity: Major
                  Found in src/Util.ts and 2 other locations - About 55 mins to fix
                  src/Util.ts on lines 855..874
                  src/Util.ts on lines 865..873

                  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 53.

                  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

                        } else if (u > 1.0) {
                          x = x2;
                          y = y2;
                          dist = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);
                        } else {
                  Severity: Major
                  Found in src/Util.ts and 2 other locations - About 55 mins to fix
                  src/Util.ts on lines 855..874
                  src/Util.ts on lines 861..873

                  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 53.

                  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 4 locations. Consider refactoring.
                  Open

                      var m21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3];
                  Severity: Major
                  Found in src/Util.ts and 3 other locations - About 50 mins to fix
                  src/Util.ts on lines 163..163
                  src/Util.ts on lines 164..164
                  src/Util.ts on lines 167..167

                  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 51.

                  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 4 locations. Consider refactoring.
                  Open

                      var m11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1];
                  Severity: Major
                  Found in src/Util.ts and 3 other locations - About 50 mins to fix
                  src/Util.ts on lines 164..164
                  src/Util.ts on lines 166..166
                  src/Util.ts on lines 167..167

                  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 51.

                  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 4 locations. Consider refactoring.
                  Open

                      var m12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1];
                  Severity: Major
                  Found in src/Util.ts and 3 other locations - About 50 mins to fix
                  src/Util.ts on lines 163..163
                  src/Util.ts on lines 166..166
                  src/Util.ts on lines 167..167

                  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 51.

                  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 4 locations. Consider refactoring.
                  Open

                      var m22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3];
                  Severity: Major
                  Found in src/Util.ts and 3 other locations - About 50 mins to fix
                  src/Util.ts on lines 163..163
                  src/Util.ts on lines 164..164
                  src/Util.ts on lines 166..166

                  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 51.

                  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

                  There are no issues that match your filters.

                  Category
                  Status