Ks89/angular-modal-gallery

View on GitHub

Showing 513 of 513 total issues

Function swipe has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  swipe(action = 'swiperight'): void {
    if (!this.currentImageConfig) {
      throw new Error('Internal library error - currentImageConfig must be defined');
    }
    switch (action) {

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

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

export const LIBCONFIG_701: ModalLibConfig = {
  currentImageConfig: {
    downloadable: true
  },
  buttonsConfig: {
Severity: Major
Found in src/app/modal-gallery/libconfigs.ts and 3 other locations - About 45 mins to fix
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 516..524
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 516..524
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 516..524

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

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

      comp.closeButton.subscribe((res: ButtonEvent) => {
        expect(res).toEqual(getButtonEvent(CUSTOM_FA_BUTTONS[2]));
      });
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 593..595
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 596..598
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 599..601

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

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 const LIBCONFIG_701: ModalLibConfig = {
  currentImageConfig: {
    downloadable: true
  },
  buttonsConfig: {
Severity: Major
Found in examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts and 3 other locations - About 45 mins to fix
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 516..524
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 516..524
src/app/modal-gallery/libconfigs.ts on lines 516..524

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

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

export const LIBCONFIG_604: ModalLibConfig = {
  currentImageConfig: {
    description: {
      strategy: DescriptionStrategy.ALWAYS_VISIBLE,
      // you should build this value programmatically with the result of (show)="..()" event
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 379..391
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 379..391
src/app/modal-gallery/libconfigs.ts on lines 365..377
src/app/modal-gallery/libconfigs.ts on lines 379..391

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

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 const LIBCONFIG_701: ModalLibConfig = {
  currentImageConfig: {
    downloadable: true
  },
  buttonsConfig: {
Severity: Major
Found in examples/universal/src/app/modal-gallery/libconfigs.ts and 3 other locations - About 45 mins to fix
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 516..524
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 516..524
src/app/modal-gallery/libconfigs.ts on lines 516..524

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

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

export const LIBCONFIG_603: ModalLibConfig = {
  currentImageConfig: {
    description: {
      strategy: DescriptionStrategy.ALWAYS_HIDDEN,
      // you should build this value programmatically with the result of (show)="..()" event
Severity: Major
Found in examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts and 7 other locations - About 45 mins to fix
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 379..391
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 379..391
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 379..391
src/app/modal-gallery/libconfigs.ts on lines 365..377
src/app/modal-gallery/libconfigs.ts on lines 379..391

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

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

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

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

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

Refactorings

Further Reading

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

export const KS_DEFAULT_BTN_DOWNLOAD: ButtonConfig = {
  className: 'download-image',
  size: KS_DEFAULT_SIZE,
  type: ButtonType.DOWNLOAD,
  title: 'Download the current image',
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons-default.ts on lines 12..18

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

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

  private buildTextDescription(image: Image, imageWithoutDescription: boolean): string {
    if (!this.currentImageConfig || !this.currentImageConfig.description) {
      throw new Error('Description input must be a valid object implementing the Description interface');
    }

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

export const LIBCONFIG_603: ModalLibConfig = {
  currentImageConfig: {
    description: {
      strategy: DescriptionStrategy.ALWAYS_HIDDEN,
      // you should build this value programmatically with the result of (show)="..()" event
Severity: Major
Found in src/app/modal-gallery/libconfigs.ts and 7 other locations - About 45 mins to fix
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 379..391
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 379..391
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 379..391
src/app/modal-gallery/libconfigs.ts on lines 379..391

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

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

  ngOnChanges(changes: SimpleChanges): void {
    if (this.id === null || this.id === undefined) {
      throw new Error('Internal library error - id must be defined');
    }
    const libConfig: LibConfig | undefined = this.configService.getConfig(this.id);

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

export const LIBCONFIG_604: ModalLibConfig = {
  currentImageConfig: {
    description: {
      strategy: DescriptionStrategy.ALWAYS_VISIBLE,
      // you should build this value programmatically with the result of (show)="..()" event
Severity: Major
Found in examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts and 7 other locations - About 45 mins to fix
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 379..391
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 379..391
src/app/modal-gallery/libconfigs.ts on lines 365..377
src/app/modal-gallery/libconfigs.ts on lines 379..391

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

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

      comp.navigate.subscribe((res: ButtonEvent) => {
        expect(res).toEqual(getButtonEvent(CUSTOM_FA_BUTTONS[4]));
      });
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 590..592
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 593..595
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 599..601

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

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

      comp.delete.subscribe((res: ButtonEvent) => {
        expect(res).toEqual(getButtonEvent(CUSTOM_FA_BUTTONS[1]));
      });
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 590..592
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 596..598
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 599..601

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

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 const LIBCONFIG_701: ModalLibConfig = {
  currentImageConfig: {
    downloadable: true
  },
  buttonsConfig: {
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 516..524
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 516..524
src/app/modal-gallery/libconfigs.ts on lines 516..524

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

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

export const LIBCONFIG_604: ModalLibConfig = {
  currentImageConfig: {
    description: {
      strategy: DescriptionStrategy.ALWAYS_VISIBLE,
      // you should build this value programmatically with the result of (show)="..()" event
Severity: Major
Found in src/app/modal-gallery/libconfigs.ts and 7 other locations - About 45 mins to fix
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 379..391
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 379..391
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 365..377
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 379..391
src/app/modal-gallery/libconfigs.ts on lines 365..377

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

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

      comp.download.subscribe((res: ButtonEvent) => {
        expect(res).toEqual(getButtonEvent(CUSTOM_FA_BUTTONS[3]));
      });
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 590..592
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 593..595
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.spec.ts on lines 596..598

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

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

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

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

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

Refactorings

Further Reading

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

export const KS_DEFAULT_BTN_CLOSE: ButtonConfig = {
  className: 'close-image',
  size: KS_DEFAULT_SIZE,
  type: ButtonType.CLOSE,
  title: 'Close this modal image gallery',
projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons-default.ts on lines 23..29

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

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

      for (let i = 0; i < previewImages.length; i++) {
        checkPreview(previews[i], previewImages[i], i === 0, DEFAULT_PREVIEW_SIZE);
      }
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 332..334
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 368..370
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 404..406
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 440..442
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 512..514
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 549..551
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 732..734
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 859..861

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

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

      for (let i = 0; i < previewImages.length; i++) {
        checkPreview(previews[i], previewImages[i], i === 0, DEFAULT_PREVIEW_SIZE);
      }
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 332..334
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 368..370
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 404..406
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 440..442
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 476..478
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 512..514
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 549..551
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.spec.ts on lines 732..734

Duplicated Code

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

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

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

Tuning

This issue has a mass of 49.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language