Ks89/angular-modal-gallery

View on GitHub

Showing 513 of 513 total issues

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

function checkCurrentImage(currentImage: Image, val: TestModel, withDots: boolean = true, withArrows: boolean = true, accessibilityConfig: AccessibilityConfig = KS_DEFAULT_ACCESSIBILITY_CONFIG): void  {

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

    function checkPreview(previewElement: DebugElement, previewImage: InternalLibImage, isActive: boolean, width: string = DEFAULT_WIDTH, height: string = DEFAULT_HEIGHT): void {

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

          const imageWithoutDescription: boolean = !image.modal || !image.modal.description || image.modal.description === '';
      projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.component.spec.ts on lines 310..310
      projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.component.ts on lines 364..364

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

        const imageWithoutDescription: boolean = !image.modal || !image.modal.description || image.modal.description === '';
      projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.component.ts on lines 326..326
      projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.component.ts on lines 364..364

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

                  expect(result?.slideConfig?.sidePreviews?.size?.width).toEqual(inputConfig.slideConfig?.sidePreviews?.size?.width);
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 132..132
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 600..600
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 601..601
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 602..602
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 603..603
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 604..604
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 605..605

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

                  expect(result?.carouselImageConfig?.description?.style?.textColor).toEqual(inputConfig.carouselImageConfig?.description?.style?.textColor);
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 131..131
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 132..132
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 600..600
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 602..602
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 603..603
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 604..604
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 605..605

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

          const imageWithoutDescription: boolean = !image.modal || !image.modal.description || image.modal.description === '';
      projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.component.spec.ts on lines 310..310
      projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.component.ts on lines 326..326

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

                  expect(result?.carouselImageConfig?.description?.style?.marginTop).toEqual(inputConfig.carouselImageConfig?.description?.style?.marginTop);
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 131..131
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 132..132
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 600..600
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 601..601
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 603..603
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 604..604
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 605..605

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

              expect(des[index].nativeElement.style.background).toContain(`url("${path}")`.trim());
      projects/ks89/angular-modal-gallery/src/lib/directives/a-tag-bg-image.directive.spec.ts on lines 171..171

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

                  expect(result?.carouselImageConfig?.description?.style?.bgColor).toEqual(inputConfig.carouselImageConfig?.description?.style?.bgColor);
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 131..131
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 132..132
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 601..601
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 602..602
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 603..603
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 604..604
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 605..605

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

                  expect(result?.carouselImageConfig?.description?.style?.marginRight).toEqual(inputConfig.carouselImageConfig?.description?.style?.marginRight);
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 131..131
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 132..132
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 600..600
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 601..601
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 602..602
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 603..603
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.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 47.

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

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

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

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

      Refactorings

      Further Reading

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

            case 'swiperight':
              if (configCurrentImageCarousel.invertSwipe) {
                this.prevImage(Action.SWIPE);
              } else {
                this.nextImage(Action.SWIPE);
      projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.component.ts on lines 476..482

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

            case 'swipeleft':
              if (configCurrentImageCarousel.invertSwipe) {
                this.nextImage(Action.SWIPE);
              } else {
                this.prevImage(Action.SWIPE);
      projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.component.ts on lines 469..475

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

              expect(des[index].nativeElement.style.background).toContain(`${style}`.trim());
      projects/ks89/angular-modal-gallery/src/lib/directives/a-tag-bg-image.directive.spec.ts on lines 170..170

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

                  expect(result?.carouselImageConfig?.description?.style?.marginLeft).toEqual(inputConfig.carouselImageConfig?.description?.style?.marginLeft);
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 131..131
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 132..132
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 600..600
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 601..601
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 602..602
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 603..603
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 605..605

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

                  expect(result?.carouselImageConfig?.description?.style?.marginBottom).toEqual(inputConfig.carouselImageConfig?.description?.style?.marginBottom);
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 131..131
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 132..132
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 600..600
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 601..601
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 602..602
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 604..604
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 605..605

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

                  expect(result?.slideConfig?.sidePreviews?.size?.height).toEqual(inputConfig.slideConfig?.sidePreviews?.size?.height);
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 131..131
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 600..600
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 601..601
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 602..602
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 603..603
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 604..604
      projects/ks89/angular-modal-gallery/src/lib/services/config.service.spec.ts on lines 605..605

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

        openModalWithDeleteButton(id: number, imagesArrayToUse: Image[], imageIndex: number, libConfig?: ModalLibConfig): void {
          const imageToShow: Image = imagesArrayToUse[imageIndex];
          const dialogRef: ModalGalleryRef = this.modalGalleryService.open({
            id,
            images: [...imagesArrayToUse],
      Severity: Minor
      Found in examples/angular-cli-18/src/app/modal-gallery/modal-gallery.component.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 openModalWithAddButton has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        openModalWithAddButton(id: number, imagesArrayToUse: Image[], imageIndex: number, libConfig?: ModalLibConfig): void {
          const imageToShow: Image = imagesArrayToUse[imageIndex];
          const dialogRef: ModalGalleryRef = this.modalGalleryService.open({
            id,
            images: imagesArrayToUse,

      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 ngOnDestroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        ngOnDestroy(): void {
          // release resources to prevent memory leaks and unexpected behaviours
          if (this.closeSubscription) {
            this.closeSubscription.unsubscribe();
          }

      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

      Severity
      Category
      Status
      Source
      Language