<commit_before><?php
namespace Hal\Violation\Class_;


use Hal\Metric\ClassMetric;
use Hal\Metric\Metric;
use Hal\Violation\Violation;

class TooDependent implements Violation
{

    /**
     * @inheritdoc
     */
    public function getName()
    {
        return 'Too dependent';
    }

    /**
     * @inheritdoc
     */
    public function apply(Metric $metric)
    {
        if (!$metric instanceof ClassMetric) {
            return;
        }

        $this->metric = $metric;

        if ($metric->get('efferentCoupling') >= 20) {
            $metric->get('violations')->add($this);
            return;
        }

    }

    /**
     * @inheritdoc
     */
    public function getLevel()
    {
        return Violation::INFO;
    }

    /**
     * @inheritdoc
     */
    public function getDescription()
    {
        return <<<EOT
This class looks use really high number of components.

* Efferent coupling is {$this->metric->get('efferentCoupling')}, so this class uses {$this->metric->get('efferentCoupling')} differents external components.

Maybe you should check why this class has lot of dependencies.
EOT;

    }
}<commit_msg>Fixed typo in description<commit_after><?php
namespace Hal\Violation\Class_;


use Hal\Metric\ClassMetric;
use Hal\Metric\Metric;
use Hal\Violation\Violation;

class TooDependent implements Violation
{

    /**
     * @inheritdoc
     */
    public function getName()
    {
        return 'Too dependent';
    }

    /**
     * @inheritdoc
     */
    public function apply(Metric $metric)
    {
        if (!$metric instanceof ClassMetric) {
            return;
        }

        $this->metric = $metric;

        if ($metric->get('efferentCoupling') >= 20) {
            $metric->get('violations')->add($this);
            return;
        }

    }

    /**
     * @inheritdoc
     */
    public function getLevel()
    {
        return Violation::INFO;
    }

    /**
     * @inheritdoc
     */
    public function getDescription()
    {
        return <<<EOT
This class looks use really high number of components.

* Efferent coupling is {$this->metric->get('efferentCoupling')}, so this class uses {$this->metric->get('efferentCoupling')} different external components.

Maybe you should check why this class has lot of dependencies.
EOT;

    }
}
{'fraction_non_alphanumeric': 0.1229829917139119, 'fraction_numerical': 0.0017444395987788923, 'mean_word_length': 2.2219101123595504, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '239816', 'n_tokens_mistral': 682, 'n_tokens_neox': 660, 'n_words': 167}