Ks89/angular-modal-gallery

View on GitHub

Showing 513 of 513 total issues

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

    TEST_MODEL.forEach((val: TestModel, index: number) => {
      it(`should display current image with arrows and side previews. Test i=${index}`, () => {
        comp.id = GALLERY_ID;
        comp.images = IMAGES;
        comp.currentImage = IMAGES[index];
projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.component.spec.ts on lines 454..481

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

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

export class NavbarComponent {
  navbarHeight = '56px';
  // path: string = PATH + '/assets/amg.svg';

  collapsed = false;
Severity: Major
Found in examples/angular-cli-18/src/app/navbar/navbar.component.ts and 3 other locations - About 1 day to fix
examples/angular-cli-material/src/app/navbar/navbar.component.ts on lines 34..62
examples/universal/src/app/navbar/navbar.component.ts on lines 34..62
src/app/navbar/navbar.component.ts on lines 34..62

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

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

export class NavbarComponent {
  navbarHeight = '56px';
  // path: string = PATH + '/assets/amg.svg';

  collapsed = false;
Severity: Major
Found in src/app/navbar/navbar.component.ts and 3 other locations - About 1 day to fix
examples/angular-cli-18/src/app/navbar/navbar.component.ts on lines 34..62
examples/angular-cli-material/src/app/navbar/navbar.component.ts on lines 34..62
examples/universal/src/app/navbar/navbar.component.ts on lines 34..62

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

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

export class NavbarComponent {
  navbarHeight = '56px';
  // path: string = PATH + '/assets/amg.svg';

  collapsed = false;
examples/angular-cli-18/src/app/navbar/navbar.component.ts on lines 34..62
examples/universal/src/app/navbar/navbar.component.ts on lines 34..62
src/app/navbar/navbar.component.ts on lines 34..62

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

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

export class NavbarComponent {
  navbarHeight = '56px';
  // path: string = PATH + '/assets/amg.svg';

  collapsed = false;
Severity: Major
Found in examples/universal/src/app/navbar/navbar.component.ts and 3 other locations - About 1 day to fix
examples/angular-cli-18/src/app/navbar/navbar.component.ts on lines 34..62
examples/angular-cli-material/src/app/navbar/navbar.component.ts on lines 34..62
src/app/navbar/navbar.component.ts on lines 34..62

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

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

File carousel.component.spec.ts has 645 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2017-2024 Stefano Cappa
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.

    File modal-gallery.component.ts has 643 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     The MIT License (MIT)
    
     Copyright (c) 2017-2024 Stefano Cappa (Ks89)
    
    
    Severity: Major
    Found in src/app/modal-gallery/modal-gallery.component.ts - About 1 day to fix

      File modal-gallery.component.ts has 643 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       The MIT License (MIT)
      
       Copyright (c) 2017-2024 Stefano Cappa (Ks89)
      
      

        File modal-gallery.component.ts has 643 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         The MIT License (MIT)
        
         Copyright (c) 2017-2021 Stefano Cappa (Ks89)
        
        
        Severity: Major
        Found in examples/universal/src/app/modal-gallery/modal-gallery.component.ts - About 1 day to fix

          File modal-gallery.component.ts has 643 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           The MIT License (MIT)
          
           Copyright (c) 2017-2024 Stefano Cappa (Ks89)
          
          

            Function setConfig has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
            Open

              setConfig(id: number, obj: LibConfig | undefined): void {
                this.initIfNotExists(id);
                if (!obj) {
                  return;
                }

            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

            File carousel-previews.component.spec.ts has 637 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Copyright (C) 2017-2021 Stefano Cappa
             *
             * Licensed under the Apache License, Version 2.0 (the "License");
             * you may not use this file except in compliance with the License.

              File modal-gallery.component.spec.ts has 630 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               The MIT License (MIT)
              
               Copyright (c) 2017-2024 Stefano Cappa (Ks89)
              
              

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

                  descriptions: Description[] | undefined[] = [
                    {
                      strategy: DescriptionStrategy.ALWAYS_VISIBLE,
                      style: {bgColor: 'rgba(0, 0, 0, 0.5)', textColor: 'white', marginTop: '0px', marginBottom: '5px', marginLeft: '0px', marginRight: '0px'}
                    },
                projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 32..59

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

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

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

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

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

                Refactorings

                Further Reading

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

                const expected: Description[] | undefined[] = [
                  {
                    strategy: DescriptionStrategy.ALWAYS_VISIBLE,
                    style: {bgColor: 'rgba(0, 0, 0, 0.5)', textColor: 'white', marginTop: '0px', marginBottom: '5px', marginLeft: '0px', marginRight: '0px'}
                  },
                projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 91..118

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

                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

                const IMAGES: Image[] = [
                  new Image(
                    0,
                    {
                      img: '/assets/images/gallery/milan-pegasus-gallery-statue.jpg',
                projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel-previews/carousel-previews.component.spec.ts on lines 64..119

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

                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

                const IMAGES: InternalLibImage[] = [
                  new InternalLibImage(
                    0,
                    {
                      img: '/assets/images/gallery/milan-pegasus-gallery-statue.jpg',
                projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.component.spec.ts on lines 111..166

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

                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

                File upper-buttons.component.spec.ts has 554 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                 * Copyright (C) 2017-2024 Stefano Cappa
                 *
                 * Licensed under the Apache License, Version 2.0 (the "License");
                 * you may not use this file except in compliance with the License.

                  File carousel.component.ts has 522 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                   The MIT License (MIT)
                  
                   Copyright (c) 2017-2024 Stefano Cappa (Ks89)
                  
                  
                  Severity: Major
                  Found in src/app/carousel/carousel.component.ts - About 1 day to fix

                    File libconfigs.ts has 515 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import {
                      ButtonsStrategy,
                      ButtonType,
                      Description,
                      DescriptionStrategy,
                    Severity: Major
                    Found in src/app/modal-gallery/libconfigs.ts - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language