original_string: public function find_problems() {
          global $DB;
          static $answer = null;
  
          if (is_null($answer)) {
              $categories = $DB->get_records('course_categories', array(), 'id');
  
              // Look for missing parents.
              $missingparent = tool_health_category_find_missing_parents($categories);
  
              // Look for loops.
              $loops = tool_health_category_find_loops($categories);
  
              $answer = array($missingparent, $loops);
          }
  
          return $answer;
      }
code: public function find_problems() {
          global $DB;
          static $answer = null;
  
          if (is_null($answer)) {
              $categories = $DB->get_records('course_categories', array(), 'id');
  
              // Look for missing parents.
              $missingparent = tool_health_category_find_missing_parents($categories);
  
              // Look for loops.
              $loops = tool_health_category_find_loops($categories);
  
              $answer = array($missingparent, $loops);
          }
  
          return $answer;
      }
code_tokens: public function find_problems ( ) { global $ DB ; static $ answer = null ; if ( is_null ( $ answer ) ) { $ categories = $ DB -> get_records ( 'course_categories' , array ( ) , 'id' ) ; // Look for missing parents. $ missingparent = tool_health_category_find_missing_parents ( $ categories ) ; // Look for loops. $ loops = tool_health_category_find_loops ( $ categories ) ; $ answer = array ( $ missingparent , $ loops ) ; } return $ answer ; }
docstring: Search for problems in the course categories.
  
  @uses $DB
  @return array List of categories that contain missing parents or loops.
docstring_tokens: Search for problems in the course categories .