<commit_before><?php
/*=========================================================================

  Program:   CDash - Cross-Platform Dashboard System
  Module:    $Id$
  Language:  PHP
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) 2002 Kitware, Inc.  All rights reserved.
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
// Return a tree of coverage directory with the number of line covered
// and not covered
include_once('api.php');

class UserAPI extends CDashAPI
{
  /** List Defects */ 
  private function ListDefects()
    { 
    include_once('../cdash/common.php');  
    if(!isset($this->Parameters['project']))  
      {
      echo "Project not set";
      exit();
      }
      
    $projectid = get_project_id($this->Parameters['project']);
    if(!is_numeric($projectid))
      {
      echo "Project not found";
      exit();
      }
 
    // We need multiple queries (4 to be exact) 
    // First for the build failures
    $users = array();
    $query = pdo_query("SELECT SUM(errors) AS nerrors,SUM(nfiles) AS nfiles,author FROM(
            SELECT b.id,bed.difference_positive AS errors,bed.difference_negative AS fixes,u.author,
            COUNT(u.author) AS nfiles, COUNT(DISTINCT u.author) AS dauthor
            FROM build2group AS b2g, buildgroup AS bg,updatefile AS u,builderrordiff AS bed, build AS b
            WHERE b.projectid=".$projectid." AND u.buildid=b.id AND b2g.buildid=b.id AND b2g.groupid=bg.id AND bg.name!='Experimental'
            AND bed.buildid=b.id AND bed.difference_positive>0 AND bed.difference_negative!=bed.difference_positive
            AND b.starttime<NOW()
            GROUP BY b.id HAVING dauthor=1) AS q GROUP BY author");
     echo pdo_error();
     
     while($query_array = pdo_fetch_array($query))
       {
       $users[$query_array['author']]['builderrors'] = $query_array['nerrors'];
       $users[$query_array['author']]['builderrorsfiles'] = $query_array['nfiles'];
       }
    
    // Then for the build fixes
    $users = array();
    $query = pdo_query("SELECT SUM(fixes) AS nfixes,SUM(nfiles) AS nfiles,author FROM(
            SELECT b.id,bed.difference_positive AS errors,bed.difference_negative AS fixes,u.author,
            COUNT(u.author) AS nfiles, COUNT(DISTINCT u.author) AS dauthor
            FROM build2group AS b2g, buildgroup AS bg,updatefile AS u,builderrordiff AS bed, build AS b
            WHERE b.projectid=".$projectid." AND u.buildid=b.id AND b2g.buildid=b.id AND b2g.groupid=bg.id AND bg.name!='Experimental'
            AND bed.buildid=b.id AND bed.difference_negative>0 AND bed.difference_positive<bed.difference_negative
            AND b.starttime<NOW()
            GROUP BY b.id HAVING dauthor=1) AS q GROUP BY author");
     echo pdo_error();<commit_msg>ENH: Improved report<commit_after><?php
/*=========================================================================

  Program:   CDash - Cross-Platform Dashboard System
  Module:    $Id$
  Language:  PHP
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) 2002 Kitware, Inc.  All rights reserved.
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
// Return a tree of coverage directory with the number of line covered
// and not covered
include_once('api.php');

class UserAPI extends CDashAPI
{
  /** List Defects */ 
  private function ListDefects()
    { 
    include_once('../cdash/common.php');  
    if(!isset($this->Parameters['project']))  
      {
      echo "Project not set";
      exit();
      }
      
    $projectid = get_project_id($this->Parameters['project']);
    if(!is_numeric($projectid))
      {
      echo "Project not found";
      exit();
      }
 
    // We need multiple queries (4 to be exact) 
    // First for the build failures
    $users = array();
    $query = pdo_query("SELECT SUM(errors) AS nerrors,SUM(nfiles) AS nfiles,author FROM(
            SELECT b.id,bed.difference_positive AS errors,u.author,
            COUNT(u.author) AS nfiles, COUNT(DISTINCT u.author) AS dauthor
            FROM build2group AS b2g, buildgroup AS bg,updatefile AS u,builderrordiff AS bed, build AS b
            WHERE b.projectid=".$projectid." AND u.buildid=b.id AND b2g.buildid=b.id AND b2g.groupid=bg.id AND bg.name!='Experimental'
            AND bed.buildid=b.id AND bed.difference_positive>0 AND bed.difference_negative!=bed.difference_positive
            AND b.starttime<NOW()
            GROUP BY b.id HAVING dauthor=1) AS q GROUP BY author");
     echo pdo_error();
     
     while($query_array = pdo_fetch_array($query))
       {
       $users[$query_array['author']]['builderrors'] = $query_array['nerrors'];
       $users[$query_array['author']]['builderrorsfiles'] = $query_array['nfiles'];
       }
    
    // Then for the build fixes
    $query = pdo_query("SELECT SUM(fixes) AS nfixes,SUM(nfiles) AS nfiles,author FROM(
            SELECT b.id,bed.difference_positive AS errors,bed.difference_negative AS fixes,u.author,
            COUNT(u.author) AS nfiles, COUNT(DISTINCT u.author) AS dauthor
            FROM build2group AS b2g, buildgroup AS bg,updatefile AS u,builderrordiff AS bed, build AS b
            WHERE b.projectid=".$projectid." AND u.buildid=b.id AND b2g.buildid=b.id AND b2g.groupid=bg.id AND bg.name!='Experimental'
            AND bed.buildid=b.id AND bed.difference_negative>0 AND bed.difference_positive<bed.difference_negative
            AND b.starttime<NOW()
            GROUP BY b.id HAVING dauthor=1) AS q GROUP BY author");
     echo pdo_error();
{'fraction_non_alphanumeric': 0.15279138099902057, 'fraction_numerical': 0.00555011426705844, 'mean_word_length': 3.0983277591973244, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7438646', 'n_tokens_mistral': 1887, 'n_tokens_neox': 1764, 'n_words': 505}