You are here

public function SiteAuditCheckContentFieldCount::calculateScore in Site Audit 7

Same name and namespace in other branches
  1. 8.2 Check/Content/FieldCount.php \SiteAuditCheckContentFieldCount::calculateScore()

Implements \SiteAudit\Check\Abstract\calculateScore().

Overrides SiteAuditCheckAbstract::calculateScore

File

Check/Content/FieldCount.php, line 102
Contains \SiteAudit\Check\Content\FieldCount.

Class

SiteAuditCheckContentFieldCount
Class SiteAuditCheckContentFieldCount.

Code

public function calculateScore() {
  $this->registry['field_api_map'] = array();

  // Only available in Drupal 7.22 and above.
  if (!function_exists('field_info_field_map')) {
    $this->abort;
    return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
  }
  $this->registry['field_api_map'] = field_info_field_map();
  if (count($this->registry['field_api_map']) == 0) {
    $this->abort;
    return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL;
  }
  elseif (count($this->registry['field_api_map']) > 75) {
    return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_WARN;
  }
  return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
}