salieri/tartarus-deep

View on GitHub
src/math/ndarray.ts

Summary

Maintainability
A
0 mins
Test Coverage

NDArray has 55 functions (exceeds 20 allowed). Consider refactoring.
Wontfix

export class NDArray {
  private static idCounter: number = 0;

  protected id: number = 0;

Severity: Major
Found in src/math/ndarray.ts - About 7 hrs to fix

    File ndarray.ts has 410 lines of code (exceeds 250 allowed). Consider refactoring.
    Wontfix

    import _ from 'lodash';
    import { Randomizer } from './randomizer';
    
    export type NumberTreeElement = number[] | number;
    export type NDArrayConstructorType = NumberTreeElement[]|NDArray[]|number[]|[number[]]|[number[][]]|[number[][][]];
    Severity: Minor
    Found in src/math/ndarray.ts - About 5 hrs to fix

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

        public min(): number {
          let knownMin: number|null = null;
      
          this.traverse(
            (value) => {
      Severity: Major
      Found in src/math/ndarray.ts and 1 other location - About 2 hrs to fix
      src/math/ndarray.ts on lines 647..663

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

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

        public max(): number {
          let knownMax: number|null = null;
      
          this.traverse(
            (value) => {
      Severity: Major
      Found in src/math/ndarray.ts and 1 other location - About 2 hrs to fix
      src/math/ndarray.ts on lines 625..641

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

      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 5 locations. Consider refactoring.
      Invalid

        public add<T extends NDArray>(this: T, addend: NDArray | number): T {
          return this.elementwiseOp(
            addend,
            (aVal: number, bVal: number): number => (aVal + bVal),
            'addition',
      Severity: Major
      Found in src/math/ndarray.ts and 4 other locations - About 2 hrs to fix
      src/math/ndarray.ts on lines 445..451
      src/math/ndarray.ts on lines 471..477
      src/math/ndarray.ts on lines 484..490
      src/math/ndarray.ts on lines 497..503

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

      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 5 locations. Consider refactoring.
      Invalid

        public sub<T extends NDArray>(this: T, subtrahend: NDArray | number): T {
          return this.elementwiseOp(
            subtrahend,
            (aVal: number, bVal: number): number => (aVal - bVal),
            'subtraction',
      Severity: Major
      Found in src/math/ndarray.ts and 4 other locations - About 2 hrs to fix
      src/math/ndarray.ts on lines 458..464
      src/math/ndarray.ts on lines 471..477
      src/math/ndarray.ts on lines 484..490
      src/math/ndarray.ts on lines 497..503

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

      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 5 locations. Consider refactoring.
      Invalid

        public mul<T extends NDArray>(this: T, multiplicand: NDArray | number): T {
          return this.elementwiseOp(
            multiplicand,
            (aVal: number, bVal: number): number => (aVal * bVal),
            'multiplication',
      Severity: Major
      Found in src/math/ndarray.ts and 4 other locations - About 2 hrs to fix
      src/math/ndarray.ts on lines 445..451
      src/math/ndarray.ts on lines 458..464
      src/math/ndarray.ts on lines 484..490
      src/math/ndarray.ts on lines 497..503

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

      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 5 locations. Consider refactoring.
      Invalid

        public pow<T extends NDArray>(this: T, exponent: NDArray | number): T {
          return this.elementwiseOp(
            exponent,
            (aVal: number, bVal: number): number => (aVal ** bVal),
            'exponentation',
      Severity: Major
      Found in src/math/ndarray.ts and 4 other locations - About 2 hrs to fix
      src/math/ndarray.ts on lines 445..451
      src/math/ndarray.ts on lines 458..464
      src/math/ndarray.ts on lines 471..477
      src/math/ndarray.ts on lines 484..490

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

      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 5 locations. Consider refactoring.
      Invalid

        public div<T extends NDArray>(this: T, divisor: NDArray | number): T {
          return this.elementwiseOp(
            divisor,
            (aVal: number, bVal: number): number => (aVal / bVal),
            'division',
      Severity: Major
      Found in src/math/ndarray.ts and 4 other locations - About 2 hrs to fix
      src/math/ndarray.ts on lines 445..451
      src/math/ndarray.ts on lines 458..464
      src/math/ndarray.ts on lines 471..477
      src/math/ndarray.ts on lines 497..503

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

      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 12 locations. Consider refactoring.
      Invalid

        public abs<T extends NDArray>(this: T): T {
          return this.apply(Math.abs);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public cos<T extends NDArray>(this: T): T {
          return this.apply(Math.cos);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public sqrt<T extends NDArray>(this: T): T {
          return this.apply(Math.sqrt);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public asin<T extends NDArray>(this: T): T {
          return this.apply(Math.asin);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public acos<T extends NDArray>(this: T): T {
          return this.apply(Math.acos);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public exp<T extends NDArray>(this: T): T {
          return this.apply(Math.exp);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public tanh<T extends NDArray>(this: T): T {
          return this.apply(Math.tanh);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public round<T extends NDArray>(this: T): T {
          return this.apply(Math.round);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599

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

      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 12 locations. Consider refactoring.
      Invalid

        public sin<T extends NDArray>(this: T): T {
          return this.apply(Math.sin);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public atan<T extends NDArray>(this: T): T {
          return this.apply(Math.atan);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public log<T extends NDArray>(this: T): T {
          return this.apply(Math.log);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 557..559
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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 12 locations. Consider refactoring.
      Invalid

        public tan<T extends NDArray>(this: T): T {
          return this.apply(Math.tan);
        }
      Severity: Major
      Found in src/math/ndarray.ts and 11 other locations - About 40 mins to fix
      src/math/ndarray.ts on lines 509..511
      src/math/ndarray.ts on lines 517..519
      src/math/ndarray.ts on lines 525..527
      src/math/ndarray.ts on lines 541..543
      src/math/ndarray.ts on lines 549..551
      src/math/ndarray.ts on lines 565..567
      src/math/ndarray.ts on lines 573..575
      src/math/ndarray.ts on lines 581..583
      src/math/ndarray.ts on lines 589..591
      src/math/ndarray.ts on lines 597..599
      src/math/ndarray.ts on lines 605..607

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

      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