aurelia/aurelia

View on GitHub
packages/testing/src/assert.ts

Summary

Maintainability
F
1 wk
Test Coverage

File assert.ts has 780 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Significant portion of this code is copy-pasted from the node.js source
// Modifications consist primarily of removing dependencies on v8 natives and adding typings

// Original license:
/*
Severity: Major
Found in packages/testing/src/assert.ts - About 1 day to fix

    Function ifError has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    export function ifError(err?: Error): void {
      if (!isNullOrUndefined(err)) {
        let message = 'ifError got unwanted exception: ';
        if (isObject(err) && isString(err.message)) {
          if (err.message.length === 0 && err.constructor) {
    Severity: Minor
    Found in packages/testing/src/assert.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 areTaskQueuesEmpty has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const areTaskQueuesEmpty = (function () {
      function round(num: number) {
        return ((num * 10 + .5) | 0) / 10;
      }
    
    
    Severity: Major
    Found in packages/testing/src/assert.ts - About 2 hrs to fix

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

      const areTaskQueuesEmpty = (function () {
        function round(num: number) {
          return ((num * 10 + .5) | 0) / 10;
        }
      
      
      Severity: Minor
      Found in packages/testing/src/assert.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 expectedException has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      function expectedException(
        actual: string | Error | IIndexable | symbol,
        expected: Function | Error | RegExp | IIndexable,
        msg?: string,
      ): boolean {
      Severity: Minor
      Found in packages/testing/src/assert.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 expectedException has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function expectedException(
        actual: string | Error | IIndexable | symbol,
        expected: Function | Error | RegExp | IIndexable,
        msg?: string,
      ): boolean {
      Severity: Minor
      Found in packages/testing/src/assert.ts - About 1 hr to fix

        Function ifError has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function ifError(err?: Error): void {
          if (!isNullOrUndefined(err)) {
            let message = 'ifError got unwanted exception: ';
            if (isObject(err) && isString(err.message)) {
              if (err.message.length === 0 && err.constructor) {
        Severity: Minor
        Found in packages/testing/src/assert.ts - About 1 hr to fix

          Function compareExceptionKey has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function compareExceptionKey(
            actual: IIndexable,
            expected: IIndexable,
            key: string,
            message: string | undefined,
          Severity: Minor
          Found in packages/testing/src/assert.ts - About 1 hr to fix

            Function expectsNoError has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function expectsNoError(
              stackStartFn: Function,
              actual: Error | symbol,
              error?: ErrorMatcher,
              message?: string,
            Severity: Minor
            Found in packages/testing/src/assert.ts - About 55 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 expectsError has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function expectsError(
              stackStartFn: Function,
              actual: Error | symbol,
              error?: ErrorMatcher,
              message?: string,
            Severity: Minor
            Found in packages/testing/src/assert.ts - About 55 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 constructor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              public constructor(
                obj: IIndexable,
                keys: string[],
                actual?: IIndexable,
              ) {
            Severity: Minor
            Found in packages/testing/src/assert.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 compareExceptionKey has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              actual: IIndexable,
              expected: IIndexable,
              key: string,
              message: string | undefined,
              keys: string[],
            Severity: Minor
            Found in packages/testing/src/assert.ts - About 35 mins to fix

              Function isInnerHtmlEqual has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function isInnerHtmlEqual(elementOrSelector: string | Node, expected: string, message?: string, root?: Node, compact: boolean = true) {
              Severity: Minor
              Found in packages/testing/src/assert.ts - About 35 mins to fix

                Avoid too many return statements within this function.
                Open

                  return expected.call({}, actual) === true;
                Severity: Major
                Found in packages/testing/src/assert.ts - About 30 mins to fix

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

                  export function lessThan(left: any, right: any, message?: string): void {
                    if (!(left < right)) {
                      innerFail({
                        actual: left,
                        expected: right,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 422..432
                  packages/testing/src/assert.ts on lines 498..508
                  packages/testing/src/assert.ts on lines 510..520
                  packages/testing/src/assert.ts on lines 534..544

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

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

                  export function greaterThanOrEqualTo(left: any, right: any, message?: string): void {
                    if (!(left >= right)) {
                      innerFail({
                        actual: left,
                        expected: right,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 422..432
                  packages/testing/src/assert.ts on lines 498..508
                  packages/testing/src/assert.ts on lines 522..532
                  packages/testing/src/assert.ts on lines 534..544

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

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

                  export function instanceOf(actual: any, expected: any, message?: string): void {
                    if (!(actual instanceof expected)) {
                      innerFail({
                        actual,
                        expected,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 498..508
                  packages/testing/src/assert.ts on lines 510..520
                  packages/testing/src/assert.ts on lines 522..532
                  packages/testing/src/assert.ts on lines 534..544

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

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

                  export function lessThanOrEqualTo(left: any, right: any, message?: string): void {
                    if (!(left <= right)) {
                      innerFail({
                        actual: left,
                        expected: right,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 422..432
                  packages/testing/src/assert.ts on lines 498..508
                  packages/testing/src/assert.ts on lines 510..520
                  packages/testing/src/assert.ts on lines 522..532

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

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

                  export function greaterThan(left: any, right: any, message?: string): void {
                    if (!(left > right)) {
                      innerFail({
                        actual: left,
                        expected: right,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 422..432
                  packages/testing/src/assert.ts on lines 510..520
                  packages/testing/src/assert.ts on lines 522..532
                  packages/testing/src/assert.ts on lines 534..544

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

                  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

                  export function notEqual(actual: any, expected: any, message?: string): void {
                    // eslint-disable-next-line eqeqeq
                    if (actual == expected) {
                      innerFail({
                        actual,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 1 other location - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 397..408

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

                  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

                  export function equal(actual: any, expected: any, message?: string): void {
                    // eslint-disable-next-line eqeqeq
                    if (actual != expected) {
                      innerFail({
                        actual,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 1 other location - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 546..557

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

                  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

                  export function isCustomElementType(actual: any, message?: string): void {
                    if (!CustomElement.isType(actual)) {
                      innerFail({
                        actual: false,
                        expected: true,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 1 other location - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 667..677

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

                  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

                  export function isCustomAttributeType(actual: any, message?: string): void {
                    if (!CustomAttribute.isType(actual)) {
                      innerFail({
                        actual: false,
                        expected: true,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 1 other location - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 655..665

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

                  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

                  export function deepStrictEqual(actual: any, expected: any, message?: string): void {
                    if (!isDeepStrictEqual(actual, expected)) {
                      innerFail({
                        actual,
                        expected,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 559..569
                  packages/testing/src/assert.ts on lines 607..617

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

                  export function deepEqual(actual: any, expected: any, message?: string): void {
                    if (!isDeepEqual(actual, expected)) {
                      innerFail({
                        actual,
                        expected,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 583..593
                  packages/testing/src/assert.ts on lines 607..617

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

                  export function strictEqual(actual: any, expected: any, message?: string): void {
                    if (!Object_is(actual, expected)) {
                      innerFail({
                        actual,
                        expected,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 559..569
                  packages/testing/src/assert.ts on lines 583..593

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

                  export function notDeepStrictEqual(actual: any, expected: any, message?: string): void {
                    if (isDeepStrictEqual(actual, expected)) {
                      innerFail({
                        actual,
                        expected,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 571..581
                  packages/testing/src/assert.ts on lines 619..629

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

                  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

                  export function notStrictEqual(actual: any, expected: any, message?: string): void {
                    if (Object_is(actual, expected)) {
                      innerFail({
                        actual,
                        expected,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 571..581
                  packages/testing/src/assert.ts on lines 595..605

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

                  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

                  export function notDeepEqual(actual: any, expected: any, message?: string): void {
                    if (isDeepEqual(actual, expected)) {
                      innerFail({
                        actual,
                        expected,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 2 hrs to fix
                  packages/testing/src/assert.ts on lines 595..605
                  packages/testing/src/assert.ts on lines 619..629

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

                  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

                  export async function doesNotReject(
                    promiseFn: () => Promise<any>,
                    errorMatcher?: ErrorMatcher,
                    message?: string,
                  ): Promise<void> {
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 1 other location - About 1 hr to fix
                  packages/testing/src/assert.ts on lines 298..304

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

                  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

                  export async function rejects(
                    promiseFn: () => Promise<any>,
                    errorMatcher?: ErrorMatcher,
                    message?: string,
                  ): Promise<void> {
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 1 other location - About 1 hr to fix
                  packages/testing/src/assert.ts on lines 314..320

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

                  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

                  export function includes(outer: any[] | string, inner: any, message?: string): void {
                    if (!outer.includes(inner)) {
                      innerFail({
                        actual: outer,
                        expected: inner,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 1 hr to fix
                  packages/testing/src/assert.ts on lines 474..484
                  packages/testing/src/assert.ts on lines 631..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 58.

                  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

                  export function match(actual: any, regex: RegExp, message?: string): void {
                    if (!regex.test(actual)) {
                      innerFail({
                        actual,
                        expected: regex,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 1 hr to fix
                  packages/testing/src/assert.ts on lines 448..458
                  packages/testing/src/assert.ts on lines 474..484

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

                  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

                  export function contains(outer: any, inner: any, message?: string): void {
                    if (!outer.contains(inner)) {
                      innerFail({
                        actual: outer,
                        expected: inner,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 1 hr to fix
                  packages/testing/src/assert.ts on lines 448..458
                  packages/testing/src/assert.ts on lines 631..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 58.

                  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

                  export function notContains(outer: any, inner: any, message?: string): void {
                    if (outer.contains(inner)) {
                      innerFail({
                        actual: outer,
                        expected: inner,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 1 hr to fix
                  packages/testing/src/assert.ts on lines 462..472
                  packages/testing/src/assert.ts on lines 643..653

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

                  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

                  export function notMatch(actual: any, regex: RegExp, message?: string): void {
                    if (regex.test(actual)) {
                      innerFail({
                        actual,
                        expected: regex,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 1 hr to fix
                  packages/testing/src/assert.ts on lines 462..472
                  packages/testing/src/assert.ts on lines 486..496

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

                  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

                  export function notIncludes(outer: any[] | string, inner: any, message?: string): void {
                    if (outer.includes(inner)) {
                      innerFail({
                        actual: outer,
                        expected: inner,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 2 other locations - About 1 hr to fix
                  packages/testing/src/assert.ts on lines 486..496
                  packages/testing/src/assert.ts on lines 643..653

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

                  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

                  export function doesNotThrow(
                    fn: () => any,
                    errorMatcher?: ErrorMatcher,
                    message?: string,
                  ): void {
                  Severity: Minor
                  Found in packages/testing/src/assert.ts and 1 other location - About 50 mins to fix
                  packages/testing/src/assert.ts on lines 290..296

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

                  export function throws(
                    fn: () => any,
                    errorMatcher?: ErrorMatcher,
                    message?: string,
                  ): void {
                  Severity: Minor
                  Found in packages/testing/src/assert.ts and 1 other location - About 50 mins to fix
                  packages/testing/src/assert.ts on lines 306..312

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

                    if (actualText !== expectedText) {
                      innerFail({
                        actual: actualText,
                        expected: expectedText,
                        message,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 40 mins to fix
                  packages/testing/src/assert.ts on lines 435..443
                  packages/testing/src/assert.ts on lines 687..695
                  packages/testing/src/assert.ts on lines 700..708
                  packages/testing/src/assert.ts on lines 720..728

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

                    if (actualText !== expectedText) {
                      innerFail({
                        actual: actualText,
                        expected: expectedText,
                        message,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 40 mins to fix
                  packages/testing/src/assert.ts on lines 386..394
                  packages/testing/src/assert.ts on lines 435..443
                  packages/testing/src/assert.ts on lines 700..708
                  packages/testing/src/assert.ts on lines 720..728

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

                    if (actual !== expected) {
                      innerFail({
                        actual: actual,
                        expected: expected,
                        message,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 40 mins to fix
                  packages/testing/src/assert.ts on lines 386..394
                  packages/testing/src/assert.ts on lines 435..443
                  packages/testing/src/assert.ts on lines 687..695
                  packages/testing/src/assert.ts on lines 720..728

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

                    if (actual !== expected) {
                      innerFail({
                        actual,
                        expected: expected,
                        message,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 40 mins to fix
                  packages/testing/src/assert.ts on lines 386..394
                  packages/testing/src/assert.ts on lines 435..443
                  packages/testing/src/assert.ts on lines 687..695
                  packages/testing/src/assert.ts on lines 700..708

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

                    if (actual instanceof expected) {
                      innerFail({
                        actual,
                        expected,
                        message,
                  Severity: Major
                  Found in packages/testing/src/assert.ts and 4 other locations - About 40 mins to fix
                  packages/testing/src/assert.ts on lines 386..394
                  packages/testing/src/assert.ts on lines 687..695
                  packages/testing/src/assert.ts on lines 700..708
                  packages/testing/src/assert.ts on lines 720..728

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

                      if (pending.length > 0) {
                        info += `  Tasks in pending:\n${pending.map(reportTask).join('')}`;
                      }
                  Severity: Minor
                  Found in packages/testing/src/assert.ts and 2 other locations - About 35 mins to fix
                  packages/testing/src/assert.ts on lines 791..793
                  packages/testing/src/assert.ts on lines 797..799

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

                  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 (processing.length > 0) {
                        info += `  Tasks in processing:\n${processing.map(reportTask).join('')}`;
                      }
                  Severity: Minor
                  Found in packages/testing/src/assert.ts and 2 other locations - About 35 mins to fix
                  packages/testing/src/assert.ts on lines 794..796
                  packages/testing/src/assert.ts on lines 797..799

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

                  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 (delayed.length > 0) {
                        info += `  Tasks in delayed:\n${delayed.map(reportTask).join('')}`;
                      }
                  Severity: Minor
                  Found in packages/testing/src/assert.ts and 2 other locations - About 35 mins to fix
                  packages/testing/src/assert.ts on lines 791..793
                  packages/testing/src/assert.ts on lines 794..796

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

                  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