public function getScore(int $maxCommits, int $maxComplexity): float
    {
        Assert::greaterThan($maxComplexity, 0);
        Assert::greaterThan($maxCommits, 0);

        /*
         * Calculate the horizontal and vertical distance from the "top right"
         * corner.
         */
        $horizontalDistance = $maxCommits - $this->getCommits();
        $verticalDistance = $maxComplexity - $this->getComplexity();

        /*
         * Normalize these values over time, we first divide by the maximum
         * values, to always end up with distances between 0 and 1.
         */
        $normalizedHorizontalDistance = $horizontalDistance / $maxCommits;
        $normalizedVerticalDistance = $verticalDistance / $maxComplexity;

        /*
         * Calculate the distance of this class from the "top right" corner,
         * using the simple formula A^2 + B^2 = C^2; or: C = sqrt(A^2 + B^2)).
         */
        $distanceFromTopRightCorner = sqrt(
            $normalizedHorizontalDistance ** 2
            + $normalizedVerticalDistance ** 2
        );

        /*
         * The resulting value will be between 0 and sqrt(2). A short distance is bad,
         * so in order to end up with a high score, we invert the value by
         * subtracting it from 1.
         */
        return round(1 - $distanceFromTopRightCorner, 3);
        // @codingStandardsIgnoreEnd
    }
public function getScore(int $maxCommits, int $maxComplexity): float
    {
        Assert::greaterThan($maxComplexity, 0);
        Assert::greaterThan($maxCommits, 0);

        /*
         * Calculate the horizontal and vertical distance from the "top right"
         * corner.
         */
        $horizontalDistance = $maxCommits - $this->getCommits();
        $verticalDistance = $maxComplexity - $this->getComplexity();

        /*
         * Normalize these values over time, we first divide by the maximum
         * values, to always end up with distances between 0 and 1.
         */
        $normalizedHorizontalDistance = $horizontalDistance / $maxCommits;
        $normalizedVerticalDistance = $verticalDistance / $maxComplexity;

        /*
         * Calculate the distance of this class from the "top right" corner,
         * using the simple formula A^2 + B^2 = C^2; or: C = sqrt(A^2 + B^2)).
         */
        $distanceFromTopRightCorner = sqrt(
            $normalizedHorizontalDistance ** 2
            + $normalizedVerticalDistance ** 2
        );

        /*
         * The resulting value will be between 0 and sqrt(2). A short distance is bad,
         * so in order to end up with a high score, we invert the value by
         * subtracting it from 1.
         */
        return round(1 - $distanceFromTopRightCorner, 3);
        // @codingStandardsIgnoreEnd
    }
public function getScore ( int $ maxCommits , int $ maxComplexity ) : float { Assert :: greaterThan ( $ maxComplexity , 0 ) ; Assert :: greaterThan ( $ maxCommits , 0 ) ; /*
         * Calculate the horizontal and vertical distance from the "top right"
         * corner.
         */ $ horizontalDistance = $ maxCommits - $ this -> getCommits ( ) ; $ verticalDistance = $ maxComplexity - $ this -> getComplexity ( ) ; /*
         * Normalize these values over time, we first divide by the maximum
         * values, to always end up with distances between 0 and 1.
         */ $ normalizedHorizontalDistance = $ horizontalDistance / $ maxCommits ; $ normalizedVerticalDistance = $ verticalDistance / $ maxComplexity ; /*
         * Calculate the distance of this class from the "top right" corner,
         * using the simple formula A^2 + B^2 = C^2; or: C = sqrt(A^2 + B^2)).
         */ $ distanceFromTopRightCorner = sqrt ( $ normalizedHorizontalDistance ** 2 + $ normalizedVerticalDistance ** 2 ) ; /*
         * The resulting value will be between 0 and sqrt(2). A short distance is bad,
         * so in order to end up with a high score, we invert the value by
         * subtracting it from 1.
         */ return round ( 1 - $ distanceFromTopRightCorner , 3 ) ; // @codingStandardsIgnoreEnd }
Calculate the score.
@param int $maxCommits    The highest number of commits out of any file scanned.
@param int $maxComplexity The maximum complexity out of any file scanned.
@return float
@codingStandardsIgnoreStart
Calculate the score .