blob: a28776ad4c4db8cf1629214ffc4dd24e7f353bde [file] [log] [blame]
<?php
/********************************************************************************
* Copyright (c) 2018 The Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
require_once dirname ( __FILE__ ) . '/../charts.inc';
function chart_ip_cq_by_project(ChartContext $context) {
return ChartBuilder::named ( 'ip_cq_by_project' )
->title ( "CQ Creation By Project (:start to :end)" )
->description ( "The number of CQs created by Eclipse projects." )
->query ('ipzilla', "
select
c.name as project,
count(distinct b.bug_id) as count
from bugs as b
join components as c on b.component_id=c.id
join keywords as k on b.bug_id=k.bug_id
join keyworddefs as kd on k.keywordid=kd.id
and kd.name in ('projectcode','thirdparty')
where
b.short_desc not regexp '\((Orbit|PB( Orbit)?|ATO)\s*\d*\)'
and c.name not in ('IP_Discussion')
and b.creation_ts between date(':start') and date(':end')
group by project
order by count desc
" )
->pieChart()
->substitute ( ':start', $context->getStart()->format('Y-m-d') )
->substitute ( ':end', $context->getEnd()->format('Y-m-d') )
->column ( 'Project', 'project', 'string')
->column ( 'Count', 'count', 'number' );
}
?>