Code Duplication    Length = 7-8 lines in 2 locations

html/inc/host.inc 1 location

@@ 597-603 (lines=7) @@
594
595
// decay a host's average credit
596
//
597
function host_decay_credit($host) {
598
    $avg = $host->expavg_credit;
599
    $avg_time = $host->expavg_time;
600
    $now = time(0);
601
    update_average($now, 0, 0, $avg, $avg_time);
602
    $host->update("expavg_credit=$avg, expavg_time=$now");
603
}
604
605
// if the host hasn't received new credit for ndays,
606
// decay its average and return true

html/inc/team.inc 1 location

@@ 524-531 (lines=8) @@
521
522
// decay a team's average credit
523
//
524
function team_decay_credit($team) {
525
    $avg = $team->expavg_credit;
526
    $avg_time = $team->expavg_time;
527
    $now = time(0);
528
    update_average($now, 0, 0, $avg, $avg_time);
529
    $team->update("expavg_credit=$avg, expavg_time=$now");
530
531
}
532
// if the team hasn't received new credit for ndays,
533
// decay its average and return true
534
//