<commit_before><?php
/** @var $ctrl \bbn\Mvc\Controller */
$ok = true;
if ( !defined('APPUI_DASHBOARD_ROOT') ){
  define('APPUI_DASHBOARD_ROOT', $ctrl->pluginUrl('appui-dashboard').'/');
  $id = $ctrl->post['id_dashboard'] ?? ($ctrl->arguments[0] ?? 'default');
  try {
    $ctrl->addInc('dashboard', new \bbn\Appui\Dashboard($id));
  }
  catch ( Exception $e ){
    $ctrl->obj->error = $e->getMessage();
    $ok = false;
  }
}
return $ok;
<commit_msg>Bugfix in _ctrl<commit_after><?php
/** @var $ctrl \bbn\Mvc\Controller */
$ok = true;
if ( !defined('APPUI_DASHBOARD_ROOT') ){
  define('APPUI_DASHBOARD_ROOT', $ctrl->pluginUrl('appui-dashboard').'/');
  if (!empty($ctrl->post['id_dashboard'])) {
    $id = $ctrl->post['id_dashboard'];
  }
  elseif ($ctrl->hasArguments() && ($ctrl->getPath() === 'home')) {
    $id = $ctrl->arguments[0];
  }
  else {
    $id = 'default';
  }

  try {
    $ctrl->addInc('dashboard', new \bbn\Appui\Dashboard($id));
  }
  catch (Exception $e) {
    $ctrl->obj->error = $e->getMessage();
    $ok = false;
  }
}

return $ok;

{'fraction_non_alphanumeric': 0.23935666982024598, 'fraction_numerical': 0.001892147587511826, 'mean_word_length': 3.8981481481481484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '4859263', 'n_tokens_mistral': 408, 'n_tokens_neox': 421, 'n_words': 65}