Ks89/angular-modal-gallery

View on GitHub

Showing 513 of 513 total issues

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

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

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

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

    this.previews = images.filter((img: InternalLibImage, i: number) => i >= this.start && i < this.end);
projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.ts on lines 254..254

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

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

    this.previews = images.filter((img: InternalLibImage, i: number) => i >= this.start && i < this.end);
projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel-previews/carousel-previews.component.ts on lines 462..462

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

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

  onFullScreen(event: ButtonEvent): void {
    const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);
    this.modalGalleryService.emitButtonBeforeHook(eventToEmit);

    // tslint:disable-next-line:no-any

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

  swipe(action = 'swiperight'): 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

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

  openModalWithOutputs(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/universal/src/app/modal-gallery/modal-gallery.component.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 initImageGrid has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private initImageGrid(): void {
    if (!this.plainGalleryConfig) {
      throw new Error('Internal library error - plainGalleryConfig must be defined');
    }

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

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

  openModalWithOutputs(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 src/app/modal-gallery/modal-gallery.component.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 constructor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(
    private ref: ChangeDetectorRef,
    private breakpointObserver: BreakpointObserver,
    // sanitizer is used only to sanitize style before add it to background property when legacyIE11Mode is enabled
    private sanitizer: DomSanitizer,

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

  openModalWithOutputs(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

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

          expect(des[index].nativeElement.style.marginTop).toBe(val.style.marginTop ? val.style.marginTop : '0px');
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 163..163
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 164..164
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 165..165
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 166..166
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 167..167
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 168..168
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 169..169
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 171..171
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 172..172
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 173..173

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

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

export const LIBCONFIG_602: ModalLibConfig = {
  currentImageConfig: {
    description: {
      strategy: DescriptionStrategy.HIDE_IF_EMPTY,
      imageText: 'Look this image ',
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 354..363
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 393..402
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 393..402
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 354..363
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 393..402
src/app/modal-gallery/libconfigs.ts on lines 343..352
src/app/modal-gallery/libconfigs.ts on lines 354..363
src/app/modal-gallery/libconfigs.ts on lines 393..402

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

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

          expect(des[index].nativeElement.style.top).toBe(val.style.top ? val.style.top : '');
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 163..163
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 165..165
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 166..166
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 167..167
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 168..168
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 169..169
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 170..170
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 171..171
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 172..172
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 173..173

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

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

          expect(des[index].nativeElement.style.left).toBe(val.style.left ? val.style.left : '');
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 163..163
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 164..164
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 165..165
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 167..167
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 168..168
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 169..169
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 170..170
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 171..171
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 172..172
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 173..173

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

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

          expect(des[index].nativeElement.style.marginLeft).toBe(val.style.marginLeft ? val.style.marginLeft : '0px');
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 163..163
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 164..164
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 165..165
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 166..166
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 167..167
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 168..168
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 169..169
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 170..170
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 171..171
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 173..173

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

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

          expect(des[index].nativeElement.style.marginBottom).toBe(val.style.marginBottom ? val.style.marginBottom : '0px');
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 163..163
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 164..164
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 165..165
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 166..166
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 167..167
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 168..168
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 169..169
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 170..170
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 172..172
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 173..173

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

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

export const LIBCONFIG_602: ModalLibConfig = {
  currentImageConfig: {
    description: {
      strategy: DescriptionStrategy.HIDE_IF_EMPTY,
      imageText: 'Look this image ',
Severity: Major
Found in examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts and 11 other locations - About 55 mins to fix
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 393..402
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 354..363
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 393..402
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 354..363
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 393..402
src/app/modal-gallery/libconfigs.ts on lines 343..352
src/app/modal-gallery/libconfigs.ts on lines 354..363
src/app/modal-gallery/libconfigs.ts on lines 393..402

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

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

          expect(des[index].nativeElement.style.marginRight).toBe(val.style.marginRight ? val.style.marginRight : '0px');
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 163..163
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 164..164
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 165..165
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 166..166
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 167..167
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 168..168
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 169..169
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 170..170
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 171..171
projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.spec.ts on lines 172..172

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

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

export const LIBCONFIG_605: ModalLibConfig = {
  currentImageConfig: {
    description: {
      strategy: DescriptionStrategy.ALWAYS_VISIBLE,
      imageText: 'Look this image ',
Severity: Major
Found in src/app/modal-gallery/libconfigs.ts and 11 other locations - About 55 mins to fix
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 354..363
examples/angular-cli-18/src/app/modal-gallery/libconfigs.ts on lines 393..402
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 354..363
examples/angular-cli-material/src/app/modal-gallery/libconfigs.ts on lines 393..402
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 343..352
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 354..363
examples/universal/src/app/modal-gallery/libconfigs.ts on lines 393..402
src/app/modal-gallery/libconfigs.ts on lines 343..352
src/app/modal-gallery/libconfigs.ts on lines 354..363

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

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