• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

juice-shop / juice-shop / 22274086982

22 Feb 2026 08:59AM UTC coverage: 86.07% (-0.8%) from 86.891%
22274086982

push

github

web-flow
Merge pull request #3084 from juice-shop/maintanace/angular-builder

Migrate to new Angular Builder

1278 of 1693 branches covered (75.49%)

Branch coverage included in aggregate %.

2 of 6 new or added lines in 4 files covered. (33.33%)

46 existing lines in 7 files now uncovered.

5420 of 6089 relevant lines covered (89.01%)

43.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.37
/frontend/src/app/code-fixes/code-fixes.component.ts
1
import { Component, Input, type OnInit, ViewChild, type DoCheck, KeyValueDiffers, type KeyValueDiffer, inject } from '@angular/core'
2
import { NgxTextDiffComponent, NgxTextDiffModule } from '@winarg/ngx-text-diff'
3

4
import { CookieService } from 'ngy-cookie'
5
import { type RandomFixes } from '../code-snippet/code-snippet.component'
6
import { type DiffTableFormat } from '@winarg/ngx-text-diff/lib/ngx-text-diff.model'
7

8
@Component({
9
  selector: 'app-code-fixes',
10
  templateUrl: './code-fixes.component.html',
11
  styleUrls: ['./code-fixes.component.scss'],
12
  imports: [NgxTextDiffModule]
13
})
14
export class CodeFixesComponent implements OnInit, DoCheck {
1✔
15
  private readonly cookieService = inject(CookieService)
22✔
16
  private readonly differs = inject(KeyValueDiffers)
22✔
17

18
  differ: KeyValueDiffer<string, DiffTableFormat>
19

20
  constructor () {
21
    const cookieService = this.cookieService
22✔
22

23
    this.cookieService = cookieService
22✔
24
    this.differ = this.differs.find({}).create()
22✔
25
  }
26

27
  @Input()
28
  public snippet = ''
22✔
29

30
  @Input()
31
  public fixes: string[] = []
22✔
32

33
  @Input()
34
  public selectedFix = 0
22✔
35

36
  @Input()
37
  public randomFixes: RandomFixes[] = []
22✔
38

39
  @Input()
40
  public format = 'SideBySide'
22✔
41

42
  @ViewChild('codeComponent', { static: false }) codeComponent: NgxTextDiffComponent
43

44
  ngOnInit (): void {
45
    if (this.cookieService.hasKey('code-fixes-component-format')) {
24✔
46
      this.format = this.cookieService.get('code-fixes-component-format')
1✔
47
    } else {
48
      this.format = 'LineByLine'
23✔
49
      this.cookieService.put('code-fixes-component-format', 'LineByLine')
23✔
50
    }
51
  }
52

53
  ngDoCheck() {
54
    if (!this.codeComponent) return
22✔
UNCOV
55
    try {
×
UNCOV
56
      const change = this.differ.diff({ 'diff-format': this.codeComponent.format })
×
57
      if (change) {
×
58
        change.forEachChangedItem(item => {
×
59
          this.format = item.currentValue
×
60
          this.cookieService.put('code-fixes-component-format', this.format)
×
61
        }
62
        )
63
      }
64
    } catch {
UNCOV
65
      console.warn('Error during diffing')
×
66
    }
67
  }
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc