Code Duplication    Length = 8-8 lines in 2 locations

html/user/host_stats.php 2 locations

@@ 65-72 (lines=8) @@
62
    $total->nhosts = 0;
63
    $total->rac = 0;
64
    $os_stats = array();
65
    foreach ($os_names as $os_name) {
66
        if (strstr($os_name, "Windows")) {
67
            $stats = get_stats("os_name='$os_name'");
68
            $os_stats[$os_name] = $stats;
69
            $total->nhosts += $stats->nhosts;
70
            $total->rac += $stats->rac;
71
        }
72
    }
73
    $os_stats = sort_stats_by_rac($os_stats);
74
    $os_stats['Windows total'] = $total;
75
    return $os_stats;
@@ 92-99 (lines=8) @@
89
    $total->nhosts = 0;
90
    $total->rac = 0;
91
    $os_stats = array();
92
    foreach ($vers as $ver) {
93
        $stats = get_stats(
94
            "os_name='Darwin' and os_version='$v'"
95
        );
96
        $os_stats[$ver] = $stats;
97
        $total->nhosts += $stats->nhosts;
98
        $total->rac += $stats->rac;
99
    }
100
    $os_stats = sort_stats_by_rac($os_stats);
101
    $os_stats['total'] = $total;
102
    return $os_stats;