<commit_before><?php
namespace BehatViewer\BehatViewerWorkerBundle\Builder;

use
    Symfony\Component\Console\Output\ConsoleOutput,
	BehatViewer\BehatViewerBundle\Entity
;

class LocalBuilder extends Builder
{
    public function build(Entity\Strategy $strategy)
    {
        parent::build($strategy);

        $path = $strategy->getPath();
        $file = $this->getBuildScript($strategy);
        $output = $this->getOutput();

        $vagrant = new \BehatViewer\BehatViewerWorkerBundle\Script\VagrantScript($file);
        $process = new \BehatViewer\BehatViewerBundle\Process\UnbefferedProcess(
            (string) $vagrant,
            $path
        );
        $process->setTimeout(600);
        $status = $process->run(function ($type, $buffer) use (&$output) {
            if ('err' === $type) {
                $output->write('<error>' . $buffer . '</error>');
            } else {
                $output->write($buffer);
            }
        });

        $analyzer = $this->container->get('behat_viewer.analyzer');
        $data = json_decode(file_get_contents($path . DIRECTORY_SEPARATOR . 'behat-viewer.json'), true);
        $analyzer->analyze($this->getProject(), $data);

        return $status;
    }<commit_msg>Fix local builder<commit_after><?php
namespace BehatViewer\BehatViewerWorkerBundle\Builder;

use
    Symfony\Component\Console\Output\ConsoleOutput,
	BehatViewer\BehatViewerBundle\Entity
;

class LocalBuilder extends Builder
{
    public function build(Entity\Strategy $strategy)
    {
        parent::build($strategy);

        $path = $strategy->getPath();
        $file = $this->getBuildScript($strategy);
        $output = $this->getOutput();

        $vagrant = new \BehatViewer\BehatViewerWorkerBundle\Script\VagrantScript($file);
        $process = new \BehatViewer\BehatViewerBundle\Process\UnbefferedProcess(
            (string) $vagrant,
            $path
        );
        $process->setTimeout(600);
        $status = $process->run(function ($type, $buffer) use (&$output) {
            if ('err' === $type) {
                $output->write('<error>' . $buffer . '</error>');
            } else {
                $output->write($buffer);
            }
        });

        $analyzer = $this->container->get('behat_viewer.analyzer');
        $data = json_decode(file_get_contents($path . DIRECTORY_SEPARATOR . 'behat-viewer.json'), true);
        $analyzer->analyze($strategy->getProject(), $data);

        return $status;
    }
{'fraction_non_alphanumeric': 0.14793856103476152, 'fraction_numerical': 0.002425222312045271, 'mean_word_length': 2.6026200873362444, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 29, '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': '3632829', 'n_tokens_mistral': 756, 'n_tokens_neox': 738, 'n_words': 114}