<commit_before><?php require __DIR__ . '/_header.php'; ?>


<?php
// calculate percentiles
function procentile($arr, $percentile = 0.95)
{
    sort($arr);
    return $arr[round($percentile * count($arr) - 1.0 - $percentile)];
}

// 1. build an associative array
$array = [];
foreach ($classes as $class) {
    if (isset($class['lloc'])) {
        array_push($array, $class['lloc']);
    }
}

// 2. percentile map
$json = [];
if(sizeof($array) > 1) {
    $range = range(0.5, 1, .05);
    foreach ($range as $percentile) {
        $json[] = (object)[
            'lloc' => procentile($array, $percentile),
            'percentile' => $percentile * 100,
        ];
    }
}

?>


<div class="row">
    <div class="column">
        <div class="bloc">
            <h4>Percentile distribution of logical lines of code by class</h4>
            <div id="lloc-repartition" style="height: 200px"></div>
            <div class="help" style="text-align: center">Percentile</div>
        </div>
    </div>
</div>

<div class="row">
    <div class="column">
        <div class="bloc">
            <h4>Explore</h4>
            <table class="js-sort-table" id="table-length">
                <thead>
                <tr>
                    <th>Class</th>
                    <th class="js-sort-number">LLOC</th>
                    <th class="js-sort-number">CLOC</th>
                    <th class="js-sort-number">Volume</th><commit_msg>Rename method - typo<commit_after><?php require __DIR__ . '/_header.php'; ?>


<?php
// calculate percentiles
function percentile($arr, $percentile = 0.95)
{
    sort($arr);
    return $arr[round($percentile * count($arr) - 1.0 - $percentile)];
}

// 1. build an associative array
$array = [];
foreach ($classes as $class) {
    if (isset($class['lloc'])) {
        array_push($array, $class['lloc']);
    }
}

// 2. percentile map
$json = [];
if(sizeof($array) > 1) {
    $range = range(0.5, 1, .05);
    foreach ($range as $percentile) {
        $json[] = (object)[
            'lloc' => percentile($array, $percentile),
            'percentile' => $percentile * 100,
        ];
    }
}

?>


<div class="row">
    <div class="column">
        <div class="bloc">
            <h4>Percentile distribution of logical lines of code by class</h4>
            <div id="lloc-repartition" style="height: 200px"></div>
            <div class="help" style="text-align: center">Percentile</div>
        </div>
    </div>
</div>

<div class="row">
    <div class="column">
        <div class="bloc">
            <h4>Explore</h4>
            <table class="js-sort-table" id="table-length">
                <thead>
                <tr>
                    <th>Class</th>
                    <th class="js-sort-number">LLOC</th>
                    <th class="js-sort-number">CLOC</th>
                    <th class="js-sort-number">Volume</th>
{'fraction_non_alphanumeric': 0.18528896672504377, 'fraction_numerical': 0.016112084063047285, 'mean_word_length': 2.094257854821235, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3294884', 'n_tokens_mistral': 975, 'n_tokens_neox': 918, 'n_words': 197}