Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CrapIndex.php

function CrapIndex::asString

File

vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php, line 28

Class

CrapIndex
@internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage

Namespace

SebastianBergmann\CodeCoverage\Node

Code

public function asString() : string {
    if ($this->codeCoverage === 0.0) {
        return (string) ($this->cyclomaticComplexity ** 2 + $this->cyclomaticComplexity);
    }
    if ($this->codeCoverage >= 95) {
        return (string) $this->cyclomaticComplexity;
    }
    return sprintf('%01.2F', $this->cyclomaticComplexity ** 2 * (1 - $this->codeCoverage / 100) ** 3 + $this->cyclomaticComplexity);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal