<commit_before><?php

@include_once 'Text/Highlighter.php';
@include_once 'Text/Highlighter/Renderer/Html.php';

class CbViewReview extends CbViewAbstract
{

    /**
     *
     * @param array  $issueList
     * @param string $filePath
     */
    public function generate(Array $issueList, $fileName, $commonPathPrefix)
    {
        if (!is_array($issueList)) {
            throw new Exception('Wrong data format for errorlist!');
        }

        $issues = $this->_formatIssues($issueList);

        $shortFilename = substr($fileName, strlen($commonPathPrefix));

        $data['issues']   = $issues;
        $data['title']    = 'Code Browser - ViewReview View';
        $data['filepath'] = $shortFilename;
        $data['csspath']  = '';
        $data['source']   = $this->_formatSourceCode($fileName, $issues);
        $data['jsCode']   = $this->_grenerateJSCode($issues);

        $depth = substr_count($shortFilename, DIRECTORY_SEPARATOR);
        $data['csspath'] = str_repeat('../', $depth-1 >= 0 ? $depth -1: 0);

        $dataGenerate['title']   = $data['title'];
        $dataGenerate['csspath'] = $data['csspath'];

        $dataGenerate['content'] = $this->_render('review', $data);

        $this->_generateView($dataGenerate, $shortFilename . '.html');
    }


    private function _grenerateJSCode($issueList)
    {
        $jsCode = '';

        foreach ($issueList as $num=>$lineIssues) {

            $htmlMessages[$num] = '';

            foreach ($lineIssues as $issue) {

                $htmlMessages[$num] .= addcslashes("<span class=\"title ".$issue->foundBy."\">".
                                      $issue->foundBy . "</span><span class=\"message\">".
                                      (string)$issue->description."</span>", "\"\'\0..\37!@\177..\377");
            }

            $jsCode .= "$('#line_".$num."').cluetip({splitTitle: '|', activation: 'click', tracking: true, cluetipClass: 'default'});";

        }<commit_msg>Tooltip Js Code<commit_after><?php

@include_once 'Text/Highlighter.php';
@include_once 'Text/Highlighter/Renderer/Html.php';

class CbViewReview extends CbViewAbstract
{

    /**
     *
     * @param array  $issueList
     * @param string $filePath
     */
    public function generate(Array $issueList, $fileName, $commonPathPrefix)
    {
        if (!is_array($issueList)) {
            throw new Exception('Wrong data format for errorlist!');
        }

        $issues = $this->_formatIssues($issueList);

        $shortFilename = substr($fileName, strlen($commonPathPrefix));

        $data['issues']   = $issues;
        $data['title']    = 'Code Browser - ViewReview View';
        $data['filepath'] = $shortFilename;
        $data['csspath']  = '';
        $data['source']   = $this->_formatSourceCode($fileName, $issues);
        $data['jsCode']   = $this->_grenerateJSCode($issues);

        $depth = substr_count($shortFilename, DIRECTORY_SEPARATOR);
        $data['csspath'] = str_repeat('../', $depth-1 >= 0 ? $depth -1: 0);

        $dataGenerate['title']   = $data['title'];
        $dataGenerate['csspath'] = $data['csspath'];

        $dataGenerate['content'] = $this->_render('review', $data);

        $this->_generateView($dataGenerate, $shortFilename . '.html');
    }


    private function _grenerateJSCode($issueList)
    {
        $jsCode = '';

        foreach ($issueList as $num=>$lineIssues) {

            $jsCode .= "$('#line_".$num."').cluetip({splitTitle: '|', activation: 'hover', 
                                                     dropShadow: false, tracking: true, cluetipClass: 'default'});";

        }
{'fraction_non_alphanumeric': 0.1766010535070696, 'fraction_numerical': 0.0047130579428888274, 'mean_word_length': 2.5303326810176126, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '739359', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1052, 'n_words': 190}