<commit_before><?php
	/** Code Checker Commands
	 * 
	 * @author		<NAME>, <<EMAIL>>
	 */
	
	namespace Heymaster\Commands;
	
	use Nette\Object,
		Heymaster\Command,
		Heymaster\Config,
		Heymaster\Cli\IRunner,
		Heymaster\Logger\ILogger,
		Heymaster\InvalidException,
		Heymaster\Commands\Css\ICssMinifier,
		Heymaster\Config\Configurator;
	
	class CodeCheckerCommands extends CommandSet
	{
		const MASK = '*';
		
		/** @var  Heymaster\Cli\IRunner */
		private $runner;
		
		/** @var  Heymaster\Logger\ILogger */
		private $logger;
		
		
		
		public function __construct(IRunner $runner, ILogger $logger)
		{
			$this->runner = $runner;
			$this->logger = $logger;
		}
		
		
		
		/**
		 * @return	$this
		 */
		public function install(Configurator $configurator)
		{
			$configurator->addCommand('CodeChecker::check', array($this, 'commandCheck'));
			
			return $this;
		}
		
		
		
		/**
		 * @param	Heymaster\Command
		 * @param	Heymaster\Config
		 * @param	string
		 * @throws	Heymaster\InvalidException
		 * @return	void
		 */
		public function commandCheck(Command $command, Config $config, $mask)
		{
			// promenna $mask je v Command::findFiles() pouzita automaticky
			$maskParam = $command->getParameter(array('mask', 'masks'), self::MASK);
			$convertLines = $command->getParameter('convertLines', FALSE);
			$fixes = $command->getParameter('fixesFiles', FALSE);
			$creator = $command->findFiles($maskParam)
				->recursive();
			$output = TRUE;
			
			$cmd = array(
				'php',
				'-f' => __DIR__ . '/../../tools/Code-Checker/code-checker.php',
				'--',
			);
			
			if($fixes)
			{
				$cmd[] = '-f';
			}
			
			if($convertLines)
			{
				$cmd[] = '-l';
			}
			
			foreach($creator->find() as $file)
			{
				$this->logger->log((string) $file);
				$cmd['-d'] = (string) $file;
				$return = $this->runner->run($cmd, $output);
				
				if($return)
				{
					$this->logger->error('Failed.')
						->end();
				}
			}
			
			$this->logger->success('Done.')
				->end();
		}
	}

<commit_msg>CodeChecker command: removed log file name<commit_after><?php
	/** Code Checker Commands
	 * 
	 * @author		<NAME>, <<EMAIL>>
	 */
	
	namespace Heymaster\Commands;
	
	use Nette\Object,
		Heymaster\Command,
		Heymaster\Config,
		Heymaster\Cli\IRunner,
		Heymaster\Logger\ILogger,
		Heymaster\InvalidException,
		Heymaster\Commands\Css\ICssMinifier,
		Heymaster\Config\Configurator;
	
	class CodeCheckerCommands extends CommandSet
	{
		const MASK = '*';
		
		/** @var  Heymaster\Cli\IRunner */
		private $runner;
		
		/** @var  Heymaster\Logger\ILogger */
		private $logger;
		
		
		
		public function __construct(IRunner $runner, ILogger $logger)
		{
			$this->runner = $runner;
			$this->logger = $logger;
		}
		
		
		
		/**
		 * @return	$this
		 */
		public function install(Configurator $configurator)
		{
			$configurator->addCommand('CodeChecker::check', array($this, 'commandCheck'));
			
			return $this;
		}
		
		
		
		/**
		 * @param	Heymaster\Command
		 * @param	Heymaster\Config
		 * @param	string
		 * @throws	Heymaster\InvalidException
		 * @return	void
		 */
		public function commandCheck(Command $command, Config $config, $mask)
		{
			// promenna $mask je v Command::findFiles() pouzita automaticky
			$maskParam = $command->getParameter(array('mask', 'masks'), self::MASK);
			$convertLines = $command->getParameter('convertLines', FALSE);
			$fixes = $command->getParameter('fixesFiles', FALSE);
			$creator = $command->findFiles($maskParam)
				->recursive();
			$output = TRUE;
			
			$cmd = array(
				'php',
				'-f' => __DIR__ . '/../../tools/Code-Checker/code-checker.php',
				'--',
			);
			
			if($fixes)
			{
				$cmd[] = '-f';
			}
			
			if($convertLines)
			{
				$cmd[] = '-l';
			}
			
			foreach($creator->find() as $file)
			{
				$cmd['-d'] = (string) $file;
				$return = $this->runner->run($cmd, $output);
				
				if($return)
				{
					$this->logger->error('Failed.')
						->end();
				}
			}
			
			$this->logger->success('Done.')
				->end();
		}
	}


{'fraction_non_alphanumeric': 0.17312984738553916, 'fraction_numerical': 0.0, 'mean_word_length': 2.77882797731569, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 47, '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': '2618308', 'n_tokens_mistral': 1765, 'n_tokens_neox': 1397, 'n_words': 243}