aurelia/aurelia

View on GitHub
packages/__tests__/src/3-runtime-html/checked-observer.spec.ts

Summary

Maintainability
F
1 wk
Test Coverage

File checked-observer.spec.ts has 785 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Constructable
} from '@aurelia/kernel';
import {
  IObserver,
Severity: Major
Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts - About 1 day to fix

    Avoid deeply nested control flow statements.
    Open

                    if (checkedBefore !== undefined) {
                      allSubACallArguments.push([checkedBefore, void 0]);
                      allSubBCallArguments.push([checkedBefore, void 0]);
                      allSubCCallArguments.push([checkedBefore, void 0]);
                    }
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                    for (const checkedAfter of [true, false]) {
                      for (const uncheckedValue of (!(checkedBefore && checkedAfter)) ? [[], [!value ? 'foo' : '']] : [[]]) {
                        for (const checkedValue of ((checkedBefore || checkedAfter) ? [[value, '']] : [[]])) {
      
                          const propValue = checkedBefore ? checkedValue : uncheckedValue;
      Severity: Major
      Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      for (const checkedValue of ((checkedBefore || checkedAfter) ? [true] : [null])) {
        
                        const propValue = checkedBefore ? checkedValue : uncheckedValue;
                        const newValue = checkedAfter ? checkedValue : uncheckedValue;
        
        
        Severity: Major
        Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                        for (const checkedAfter of [true, false]) {
                          for (const uncheckedValue of (!(checkedBefore && checkedAfter)) ? [[], [!value ? 'foo' : '']] : [[]]) {
                            for (const checkedValue of ((checkedBefore || checkedAfter) ? [[value, '']] : [[]])) {
          
                              const propValue = checkedBefore ? checkedValue : uncheckedValue;
          Severity: Major
          Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                          for (const event of ['change', 'input']) {
            
                            it(_`${prop}=${value}, checkedBefore=${checkedBefore}, checkedAfter=${checkedAfter}, event=${event}`, function () {
            
                              const { ctx, sut, el, subscriber } = createFixture(value, prop);
            Severity: Major
            Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                              if (checkedAfter !== checkedBefore) {
                                allSubACallArguments.push([checkedAfter, checkedBefore]);
                                allSubBCallArguments.push([checkedAfter, checkedBefore]);
                                allSubCCallArguments.push([checkedAfter, checkedBefore]);
                              }
              Severity: Major
              Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts - About 45 mins to fix

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

                      function createFixture(hasSubscriber: boolean, value: any, prop: string) {
                        const ctx = TestContext.create();
                        const { container, observerLocator, platform } = ctx;
                
                        const el = ctx.createElementFromMarkup(`<input type="checkbox"/>`) as ObservedInputElement;
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 731..748

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

                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

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

                      function createFixture(hasSubscriber: boolean, value: any, prop: string) {
                        const ctx = TestContext.create();
                        const { container, observerLocator, platform } = ctx;
                
                        const el = ctx.createElementFromMarkup(`<input type="checkbox"/>`) as ObservedInputElement;
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 657..674

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

                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

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

                      function tearDown({ ctx, sutA, sutB, sutC, elA, elB, elC }: Partial<ReturnType<typeof createFixture>>) {
                        ctx.doc.body.removeChild(elA);
                        ctx.doc.body.removeChild(elB);
                        ctx.doc.body.removeChild(elC);
                      }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 498..502

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

                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

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

                      function tearDown({ ctx, sutA, sutB, sutC, elA, elB, elC }: Partial<ReturnType<typeof createFixture>>) {
                        ctx.doc.body.removeChild(elA);
                        ctx.doc.body.removeChild(elB);
                        ctx.doc.body.removeChild(elC);
                      }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 608..612

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

                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

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

                      $it(title, async function () {
                        const { ctx, component, testHost, tearDown } = await createFixture<any>(
                          template,
                          ViewModel,
                        );
                packages/__tests__/src/3-runtime-html/array-index-observer.spec.ts on lines 175..184

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 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 2 locations. Consider refactoring.
                Open

                    return {
                      ctx,
                      au,
                      container,
                      testHost,
                packages/__tests__/src/3-runtime-html/array-index-observer.spec.ts on lines 202..214

                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

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

                        return { ctx, container, observerLocator, platform, elA, elB, elC, sutA, sutB, sutC, subscriberA, subscriberB, subscriberC };
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 604..604

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

                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

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

                        return { ctx, container, observerLocator, platform, elA, elB, elC, sutA, sutB, sutC, subscriberA, subscriberB, subscriberC };
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 494..494

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

                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

                  function createItems(count: number): IAppItem[] {
                    return Array.from({ length: count }, (_, i) => ({
                      name: `item ${i}`,
                      value: i,
                    }));
                packages/__tests__/src/3-runtime-html/repeat.contextual-props.spec.ts on lines 430..432

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

                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

                  interface ITestCase<T extends IApp = IApp> {
                    title: string;
                    template: string;
                    ViewModel?: Constructable<T>;
                    assertFn: AssertionFn;
                packages/__tests__/src/3-runtime-html/array-index-observer.spec.ts on lines 21..27

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 63.

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

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

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

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

                Refactorings

                Further Reading

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

                      function tearDown({ ctx, el }: Partial<ReturnType<typeof createFixture>>) {
                        ctx.doc.body.removeChild(el);
                      }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 347..349
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 425..427
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 676..678
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 750..752
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 817..819
                packages/__tests__/src/3-runtime-html/value-attribute-observer.spec.ts on lines 118..120

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

                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

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

                      function tearDown({ ctx, el }: Partial<ReturnType<typeof createFixture>>) {
                        ctx.doc.body.removeChild(el);
                      }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 347..349
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 425..427
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 676..678
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 817..819
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 924..926
                packages/__tests__/src/3-runtime-html/value-attribute-observer.spec.ts on lines 118..120

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

                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

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

                      function tearDown({ ctx, el }: Partial<ReturnType<typeof createFixture>>) {
                        ctx.doc.body.removeChild(el);
                      }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 347..349
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 676..678
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 750..752
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 817..819
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 924..926
                packages/__tests__/src/3-runtime-html/value-attribute-observer.spec.ts on lines 118..120

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

                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

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

                      function tearDown({ ctx, el }: Partial<ReturnType<typeof createFixture>>) {
                        ctx.doc.body.removeChild(el);
                      }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 347..349
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 425..427
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 750..752
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 817..819
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 924..926
                packages/__tests__/src/3-runtime-html/value-attribute-observer.spec.ts on lines 118..120

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

                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

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

                      function tearDown({ ctx, el }: Partial<ReturnType<typeof createFixture>>) {
                        ctx.doc.body.removeChild(el);
                      }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 425..427
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 676..678
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 750..752
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 817..819
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 924..926
                packages/__tests__/src/3-runtime-html/value-attribute-observer.spec.ts on lines 118..120

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

                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

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

                      function tearDown({ ctx, el }: Partial<ReturnType<typeof createFixture>>) {
                        ctx.doc.body.removeChild(el);
                      }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 347..349
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 425..427
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 676..678
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 750..752
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 924..926
                packages/__tests__/src/3-runtime-html/value-attribute-observer.spec.ts on lines 118..120

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

                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

                                  if (checkedBefore) {
                                    assert.strictEqual(actual[0], prop === 'value' ? (value !== null ? `${value}` : '') : value, `actual[0]`); // TODO: maybe we should coerce value in the observer
                                  } else {
                                    assert.strictEqual(actual, array, `actual`);
                                  }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 870..874

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

                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

                                  if (checkedAfter) {
                                    assert.strictEqual(actual[0], prop === 'value' ? (value !== null ? `${value}` : '') : value, `actual[0]`); // TODO: maybe we should coerce value in the observer
                                  } else {
                                    assert.strictEqual(actual, array, `actual`);
                                  }
                packages/__tests__/src/3-runtime-html/checked-observer.spec.ts on lines 861..865

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

                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

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

                  interface AssertionFn<T extends IApp = IApp> {
                    // eslint-disable-next-line @typescript-eslint/prefer-function-type
                    (ctx: TestContext, testHost: HTMLElement, component: T): void | Promise<void>;
                  }
                packages/__tests__/src/3-runtime-html/array-index-observer.spec.ts on lines 29..32

                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

                        return { ctx, value, container, observerLocator, platform, el, sut, subscriber, valueOrModelObserver };
                Severity: Major
                Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts and 2 other locations - About 40 mins to fix
                packages/__tests__/src/compat-v1/event-delegator.spec.ts on lines 82..82
                packages/__tests__/src/router/_shared/hooks.ts on lines 94..104

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

                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

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

                      const $it = (title_: string, fn: Mocha.Func) => only ? it.only(title_, fn) : it(title_, fn);
                Severity: Minor
                Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts and 2 other locations - About 40 mins to fix
                packages/__tests__/src/3-runtime-html/array-index-observer.spec.ts on lines 174..174
                packages/__tests__/src/3-runtime-html/computed-observer.spec.ts on lines 386..386

                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