Fix warnings

This commit is contained in:
Laurent Destailleur 2023-08-26 10:16:46 +02:00
parent 5aca60fb52
commit 55bb9d7136

View File

@ -157,13 +157,15 @@ foreach (array('proj', 'dep') as $source) {
}
}
foreach ($arrayoflineofcode[$source] as $key => $val) {
$arrayofmetrics[$source]['Files'] += $val['Files'];
$arrayofmetrics[$source]['Lines'] += $val['Lines'];
$arrayofmetrics[$source]['Blanks'] += $val['Blanks'];
$arrayofmetrics[$source]['Comments'] += $val['Comments'];
$arrayofmetrics[$source]['Code'] += $val['Code'];
$arrayofmetrics[$source]['Complexity'] += $val['Complexity'];
if (!empty($arrayoflineofcode[$source])) {
foreach ($arrayoflineofcode[$source] as $key => $val) {
$arrayofmetrics[$source]['Files'] += $val['Files'];
$arrayofmetrics[$source]['Lines'] += $val['Lines'];
$arrayofmetrics[$source]['Blanks'] += $val['Blanks'];
$arrayofmetrics[$source]['Comments'] += $val['Comments'];
$arrayofmetrics[$source]['Code'] += $val['Code'];
$arrayofmetrics[$source]['Complexity'] += $val['Complexity'];
}
}
}
@ -267,18 +269,20 @@ foreach (array('proj', 'dep') as $source) {
$html .= '<td class="right">'.formatNumber($arrayofmetrics[$source]['Code']).'</td>';
$html .= '<td>TODO graph here...</td>';
$html .= '</tr>';
foreach ($arrayoflineofcode[$source] as $key => $val) {
$html .= '<tr class="loc hidden source'.$source.' language'.str_replace(' ', '', $key).'">';
$html .= '<td>'.$key.'</td>';
$html .= '<td class="right"></td>';
$html .= '<td class="right">'.(empty($val['Files']) ? '' : formatNumber($val['Files'])).'</td>';
$html .= '<td class="right">'.(empty($val['Lines']) ? '' : formatNumber($val['Lines'])).'</td>';
$html .= '<td class="right">'.(empty($val['Blanks']) ? '' : formatNumber($val['Blanks'])).'</td>';
$html .= '<td class="right">'.(empty($val['Comments']) ? '' : formatNumber($val['Comments'])).'</td>';
$html .= '<td class="right">'.(empty($val['Code']) ? '' : formatNumber($val['Code'])).'</td>';
//$html .= '<td class="right">'.(empty($val['Complexity']) ? '' : $val['Complexity']).'</td>';
$html .= '<td>TODO graph here...</td>';
$html .= '</tr>';
if (!empty($arrayoflineofcode[$source])) {
foreach ($arrayoflineofcode[$source] as $key => $val) {
$html .= '<tr class="loc hidden source'.$source.' language'.str_replace(' ', '', $key).'">';
$html .= '<td>'.$key.'</td>';
$html .= '<td class="right"></td>';
$html .= '<td class="right">'.(empty($val['Files']) ? '' : formatNumber($val['Files'])).'</td>';
$html .= '<td class="right">'.(empty($val['Lines']) ? '' : formatNumber($val['Lines'])).'</td>';
$html .= '<td class="right">'.(empty($val['Blanks']) ? '' : formatNumber($val['Blanks'])).'</td>';
$html .= '<td class="right">'.(empty($val['Comments']) ? '' : formatNumber($val['Comments'])).'</td>';
$html .= '<td class="right">'.(empty($val['Code']) ? '' : formatNumber($val['Code'])).'</td>';
//$html .= '<td class="right">'.(empty($val['Complexity']) ? '' : $val['Complexity']).'</td>';
$html .= '<td>TODO graph here...</td>';
$html .= '</tr>';
}
}
}
@ -299,8 +303,12 @@ $html .= '</section>';
$html .= '<section class="chapter">';
$html .= '<h2>Project value</h2><br>';
$html .= 'COCOMO (Basic organic model) value: $'.formatNumber($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency'], 2).'<br>';
$html .= 'COCOMO (Basic organic model) effort: '.formatNumber($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']).' monthes people<br>';
$html .= 'COCOMO (Basic organic model) value: $';
$html .= formatNumber($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency'], 2);
$html .= '<br>';
$html .= 'COCOMO (Basic organic model) effort: ';
$html .= formatNumber($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']);
$html .= ' monthes people<br>';
$html .= '</section>';
$html .= '<section class="chapter">';