aurelia/aurelia

View on GitHub
packages/runtime-html/src/templating/controller.ts

Summary

Maintainability
F
2 wks
Test Coverage
B
87%

File controller.ts has 1268 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
import {
  AnyFunction,
  IIndexable,
  ILogger,
Severity: Major
Found in packages/runtime-html/src/templating/controller.ts - About 3 days to fix

    Controller has 42 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class Controller<C extends IViewModel = IViewModel> implements IController<C> {
    
      public head: IHydratedController | null = null;
      public tail: IHydratedController | null = null;
      public next: IHydratedController | null = null;
    Severity: Minor
    Found in packages/runtime-html/src/templating/controller.ts - About 5 hrs to fix

      Function _leaveDetaching has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

        private _leaveDetaching(): void {
          if (--this._detachingStack === 0) {
            // Note: this controller is the initiator (detach is only ever called on the initiator)
            /* istanbul ignore next */
            if (__DEV__ && this.debug) { this.logger!.trace(`detach()`); }
      Severity: Minor
      Found in packages/runtime-html/src/templating/controller.ts - About 4 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 createObservers has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      function createObservers(
        controller: Controller,
        definition: CustomElementDefinition | CustomAttributeDefinition,
        instance: IIndexable<ICustomElementViewModel | ICustomAttributeViewModel>,
      ): void {
      Severity: Minor
      Found in packages/runtime-html/src/templating/controller.ts - About 3 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 activate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

        public activate(
          initiator: IHydratedController,
          parent: IHydratedController | null,
          scope?: Scope | null,
        ): void | Promise<void> {
      Severity: Minor
      Found in packages/runtime-html/src/templating/controller.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 _hydrate has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

        public _hydrate(): void {
          if (this._lifecycleHooks!.hydrating != null) {
            this._lifecycleHooks!.hydrating.forEach(callHydratingHook, this);
          }
          if (this._vmHooks._hydrating) {
      Severity: Minor
      Found in packages/runtime-html/src/templating/controller.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 deactivate has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public deactivate(
          initiator: IHydratedController,
          _parent: IHydratedController | null,
        ): void | Promise<void> {
          let prevActivation: void | Promise<void> = void 0;
      Severity: Major
      Found in packages/runtime-html/src/templating/controller.ts - About 2 hrs to fix

        Function activate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public activate(
            initiator: IHydratedController,
            parent: IHydratedController | null,
            scope?: Scope | null,
          ): void | Promise<void> {
        Severity: Major
        Found in packages/runtime-html/src/templating/controller.ts - About 2 hrs to fix

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

            private _attach(): void {
              /* istanbul ignore next */
              if (__DEV__ && this.debug) { this.logger!.trace(`attach()`); }
          
              if (this.hostController !== null) {
          Severity: Minor
          Found in packages/runtime-html/src/templating/controller.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 _attach has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            private _attach(): void {
              /* istanbul ignore next */
              if (__DEV__ && this.debug) { this.logger!.trace(`attach()`); }
          
              if (this.hostController !== null) {
          Severity: Major
          Found in packages/runtime-html/src/templating/controller.ts - About 2 hrs to fix

            Function _hydrate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public _hydrate(): void {
                if (this._lifecycleHooks!.hydrating != null) {
                  this._lifecycleHooks!.hydrating.forEach(callHydratingHook, this);
                }
                if (this._vmHooks._hydrating) {
            Severity: Minor
            Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

              Function _leaveActivating has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                private _leaveActivating(): void {
                  if (this.state !== activating) {
                    --this._activatingStack;
                    // skip doing rest of the work if the controller is deactivated.
                    this._resolve();
              Severity: Minor
              Found in packages/runtime-html/src/templating/controller.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 createWatchers has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function createWatchers(
                controller: Controller,
                context: IServiceLocator,
                definition: CustomElementDefinition | CustomAttributeDefinition,
                instance: object,
              Severity: Minor
              Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

                Function _leaveActivating has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private _leaveActivating(): void {
                    if (this.state !== activating) {
                      --this._activatingStack;
                      // skip doing rest of the work if the controller is deactivated.
                      this._resolve();
                Severity: Minor
                Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

                  Function bind has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    private bind(): void {
                      /* istanbul ignore next */
                      if (__DEV__ && this.debug) { this.logger!.trace(`bind()`); }
                  
                      let i = 0;
                  Severity: Minor
                  Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

                    Function createWatchers has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function createWatchers(
                      controller: Controller,
                      context: IServiceLocator,
                      definition: CustomElementDefinition | CustomAttributeDefinition,
                      instance: object,
                    Severity: Minor
                    Found in packages/runtime-html/src/templating/controller.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 $el has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                      public static $el<C extends ICustomElementViewModel = ICustomElementViewModel>(
                        ctn: IContainer,
                        viewModel: C,
                        host: HTMLElement,
                        hydrationInst: IControllerElementHydrationInstruction | null,
                    Severity: Minor
                    Found in packages/runtime-html/src/templating/controller.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 $el has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public static $el<C extends ICustomElementViewModel = ICustomElementViewModel>(
                        ctn: IContainer,
                        viewModel: C,
                        host: HTMLElement,
                        hydrationInst: IControllerElementHydrationInstruction | null,
                    Severity: Minor
                    Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

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

                        private _leaveDetaching(): void {
                          if (--this._detachingStack === 0) {
                            // Note: this controller is the initiator (detach is only ever called on the initiator)
                            /* istanbul ignore next */
                            if (__DEV__ && this.debug) { this.logger!.trace(`detach()`); }
                      Severity: Minor
                      Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

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

                          private bind(): void {
                            /* istanbul ignore next */
                            if (__DEV__ && this.debug) { this.logger!.trace(`bind()`); }
                        
                            let i = 0;
                        Severity: Minor
                        Found in packages/runtime-html/src/templating/controller.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 unbind has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          private unbind(): void {
                            /* istanbul ignore next */
                            if (__DEV__ && this.debug) { this.logger!.trace(`unbind()`); }
                        
                            let i = 0;
                        Severity: Minor
                        Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

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

                            public _hydrateCustomElement(
                              hydrationInst: IControllerElementHydrationInstruction | null,
                              /**
                               * The context where this custom element is hydrated.
                               *
                          Severity: Minor
                          Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

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

                            function createObservers(
                              controller: Controller,
                              definition: CustomElementDefinition | CustomAttributeDefinition,
                              instance: IIndexable<ICustomElementViewModel | ICustomAttributeViewModel>,
                            ): void {
                            Severity: Minor
                            Found in packages/runtime-html/src/templating/controller.ts - About 1 hr to fix

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

                                private unbind(): void {
                                  /* istanbul ignore next */
                                  if (__DEV__ && this.debug) { this.logger!.trace(`unbind()`); }
                              
                                  let i = 0;
                              Severity: Minor
                              Found in packages/runtime-html/src/templating/controller.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 accept has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                public accept(visitor: ControllerVisitor): void | true {
                                  if (visitor(this as IHydratedController) === true) {
                                    return true;
                                  }
                              
                              
                              Severity: Minor
                              Found in packages/runtime-html/src/templating/controller.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 deactivate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                public deactivate(
                                  initiator: IHydratedController,
                                  _parent: IHydratedController | null,
                                ): void | Promise<void> {
                                  let prevActivation: void | Promise<void> = void 0;
                              Severity: Minor
                              Found in packages/runtime-html/src/templating/controller.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 _leaveUnbinding has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                private _leaveUnbinding(): void {
                                  if (--this._unbindingStack === 0) {
                                    /* istanbul ignore next */
                                    if (__DEV__ && this.debug) { this.logger!.trace(`unbind()`); }
                              
                              
                              Severity: Minor
                              Found in packages/runtime-html/src/templating/controller.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

                              Avoid deeply nested control flow statements.
                              Open

                                          if (cur.debug) { cur.logger!.trace('unbinding()'); }
                              Severity: Major
                              Found in packages/runtime-html/src/templating/controller.ts - About 45 mins to fix

                                Function stringifyState has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function stringifyState(state: State): string {
                                  const names: string[] = [];
                                
                                  if ((state & activating) === activating) { names.push('activating'); }
                                  if ((state & activated) === activated) { names.push('activated'); }
                                Severity: Minor
                                Found in packages/runtime-html/src/templating/controller.ts - About 35 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 _hydrateCustomElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  public _hydrateCustomElement(
                                    hydrationInst: IControllerElementHydrationInstruction | null,
                                    /**
                                     * The context where this custom element is hydrated.
                                     *
                                Severity: Minor
                                Found in packages/runtime-html/src/templating/controller.ts - About 35 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 name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  public get name(): string {
                                    if (this.parent === null) {
                                      switch (this.vmKind) {
                                        case vmkCa:
                                          return `[${this.definition!.name}]`;
                                Severity: Minor
                                Found in packages/runtime-html/src/templating/controller.ts - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

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

                                    if (this.vmKind !== vmkSynth && this._lifecycleHooks!.binding != null) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`lifecycleHooks.binding()`); }
                                
                                      ret = onResolveAll(...this._lifecycleHooks!.binding!.map(callBindingHook, this));
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 1 other location - About 3 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 706..711

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

                                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 (this.vmKind !== vmkSynth && this._lifecycleHooks!.attaching != null) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`lifecycleHooks.attaching()`); }
                                
                                      ret = onResolveAll(...this._lifecycleHooks!.attaching!.map(callAttachingHook, this));
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 1 other location - About 3 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 563..568

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

                                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

                                  public setShadowRoot(shadowRoot: ShadowRoot): this {
                                    if (this.vmKind === vmkCe) {
                                      setRef(shadowRoot, elementBaseName, this as IHydratedController);
                                      setRef(shadowRoot, this.definition!.key, this as IHydratedController);
                                    }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 3 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1124..1132
                                packages/runtime-html/src/templating/controller.ts on lines 1144..1152

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

                                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

                                  public setLocation(location: IRenderLocation): this {
                                    if (this.vmKind === vmkCe) {
                                      setRef(location, elementBaseName, this as IHydratedController);
                                      setRef(location, this.definition!.key, this as IHydratedController);
                                    }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 3 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1124..1132
                                packages/runtime-html/src/templating/controller.ts on lines 1134..1142

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

                                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

                                  public setHost(host: HTMLElement): this {
                                    if (this.vmKind === vmkCe) {
                                      setRef(host, elementBaseName, this as IHydratedController);
                                      setRef(host, this.definition!.key, this as IHydratedController);
                                    }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 3 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1134..1142
                                packages/runtime-html/src/templating/controller.ts on lines 1144..1152

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

                                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 (this._vmHooks._attaching) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`attaching()`); }
                                
                                      ret = onResolveAll(ret, this._vm!.attaching(this.$initiator, this.parent));
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 570..575
                                packages/runtime-html/src/templating/controller.ts on lines 622..627

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

                                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 (this._vmHooks._binding) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`binding()`); }
                                
                                      ret = onResolveAll(ret, this._vm!.binding(this.$initiator, this.parent));
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 622..627
                                packages/runtime-html/src/templating/controller.ts on lines 713..718

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

                                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 (this._vmHooks._bound) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`bound()`); }
                                
                                      ret = onResolveAll(ret, this._vm!.bound(this.$initiator, this.parent));
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 570..575
                                packages/runtime-html/src/templating/controller.ts on lines 713..718

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

                                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 (isPromise(ret)) {
                                      this._ensurePromise();
                                      this._enterActivating();
                                      ret.then(() => {
                                        this._leaveActivating();
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 1 other location - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1041..1049

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

                                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 (isPromise(ret)) {
                                          this._ensurePromise();
                                          this._enterUnbinding();
                                          ret.then(() => {
                                            this._leaveUnbinding();
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 1 other location - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.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 81.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    if (this._vmHooks._hydrating) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`invoking hydrating() hook`); }
                                      this._vm!.hydrating(this as ICustomElementController);
                                    }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 3 other locations - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 442..446
                                packages/runtime-html/src/templating/controller.ts on lines 461..465
                                packages/runtime-html/src/templating/controller.ts on lines 484..488

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

                                    if (this._vmHooks._created) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`invoking created() hook`); }
                                      this._vm!.created(this as ICustomElementController);
                                    }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 3 other locations - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 397..401
                                packages/runtime-html/src/templating/controller.ts on lines 442..446
                                packages/runtime-html/src/templating/controller.ts on lines 484..488

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

                                    if (this._vmHooks._created) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`invoking created() hook`); }
                                      this._vm!.created(this as ICustomAttributeController);
                                    }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 3 other locations - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 397..401
                                packages/runtime-html/src/templating/controller.ts on lines 442..446
                                packages/runtime-html/src/templating/controller.ts on lines 461..465

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

                                    if (this._vmHooks._hydrated) {
                                      /* istanbul ignore next */
                                      if (__DEV__ && this.debug) { this.logger!.trace(`invoking hydrated() hook`); }
                                      this._vm!.hydrated(this as ICustomElementController);
                                    }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 3 other locations - About 2 hrs to fix
                                packages/runtime-html/src/templating/controller.ts on lines 397..401
                                packages/runtime-html/src/templating/controller.ts on lines 461..465
                                packages/runtime-html/src/templating/controller.ts on lines 484..488

                                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

                                  public addChild(controller: Controller): void {
                                    if (this.children === null) {
                                      this.children = [controller];
                                    } else {
                                      this.children[this.children.length] = controller;
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 1 other location - About 1 hr to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1092..1098

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

                                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

                                  public addBinding(binding: IBinding): void {
                                    if (this.bindings === null) {
                                      this.bindings = [binding];
                                    } else {
                                      this.bindings[this.bindings.length] = binding;
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 1 other location - About 1 hr to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1100..1106

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                function callBoundHook(this: Controller, l: LifecycleHooksEntry<IActivationHooks<IHydratedController>, 'bound'>) {
                                  return l.instance.bound(this._vm!, this['$initiator'], this.parent!);
                                }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 3 other locations - About 1 hr to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1868..1870
                                packages/runtime-html/src/templating/controller.ts on lines 1876..1878
                                packages/runtime-html/src/templating/controller.ts on lines 1884..1886

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                function callDetachingHook(this: Controller, l: LifecycleHooksEntry<IActivationHooks<IHydratedController>, 'detaching'>) {
                                  return l.instance.detaching(this._vm!, this['$initiator'], this.parent!);
                                }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 3 other locations - About 1 hr to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1868..1870
                                packages/runtime-html/src/templating/controller.ts on lines 1872..1874
                                packages/runtime-html/src/templating/controller.ts on lines 1876..1878

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                function callBindingHook(this: Controller, l: LifecycleHooksEntry<IActivationHooks<IHydratedController>, 'binding'>) {
                                  return l.instance.binding(this._vm!, this['$initiator'], this.parent!);
                                }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 3 other locations - About 1 hr to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1872..1874
                                packages/runtime-html/src/templating/controller.ts on lines 1876..1878
                                packages/runtime-html/src/templating/controller.ts on lines 1884..1886

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                function callAttachingHook(this: Controller, l: LifecycleHooksEntry<IActivationHooks<IHydratedController>, 'attaching'>) {
                                  return l.instance.attaching(this._vm!, this['$initiator'], this.parent!);
                                }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 3 other locations - About 1 hr to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1868..1870
                                packages/runtime-html/src/templating/controller.ts on lines 1872..1874
                                packages/runtime-html/src/templating/controller.ts on lines 1884..1886

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

                                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 callHydratedHook(this: Controller, l: LifecycleHooksEntry<ICompileHooks, 'hydrated'>) {
                                  l.instance.hydrated(this._vm!, this as ICompiledCustomElementController<ICompileHooks>);
                                }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 1 other location - About 1 hr to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1860..1862

                                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

                                function callHydratingHook(this: Controller, l: LifecycleHooksEntry<ICompileHooks, 'hydrating'>) {
                                  l.instance.hydrating(this._vm!, this as IContextualCustomElementController<ICompileHooks>);
                                }
                                Severity: Major
                                Found in packages/runtime-html/src/templating/controller.ts and 1 other location - About 1 hr to fix
                                packages/runtime-html/src/templating/controller.ts on lines 1864..1866

                                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

                                    if (this._lifecycleHooks!.created !== void 0) {
                                      this._lifecycleHooks!.created.forEach(callCreatedHook, this);
                                    }
                                Severity: Minor
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 30 mins to fix
                                packages/runtime-html/src/templating/controller.ts on lines 438..440
                                packages/runtime-html/src/templating/controller.ts on lines 458..460

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

                                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 (this._lifecycleHooks!.hydrated !== void 0) {
                                      this._lifecycleHooks!.hydrated.forEach(callHydratedHook, this);
                                    }
                                Severity: Minor
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 30 mins to fix
                                packages/runtime-html/src/templating/controller.ts on lines 458..460
                                packages/runtime-html/src/templating/controller.ts on lines 481..483

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

                                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 (this._lifecycleHooks!.created !== void 0) {
                                      this._lifecycleHooks!.created.forEach(callCreatedHook, this);
                                    }
                                Severity: Minor
                                Found in packages/runtime-html/src/templating/controller.ts and 2 other locations - About 30 mins to fix
                                packages/runtime-html/src/templating/controller.ts on lines 438..440
                                packages/runtime-html/src/templating/controller.ts on lines 481..483

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

                                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