Overview.aspx, Overview.aspx.cs: Remove the 'Most Needed' table, as it takes ages to generate and duplicates the 'API Report' page anyway.

APIReport.aspx, APIReport.aspx.cs: Show counts for total number of reported issues, number of applications per reported issue, and the ratio of counts per application.  Only include P/Invokes and issues from latest definition set.

svn path=/trunk/moma-tool/; revision=121686
This commit is contained in:
Dick Porter 2008-12-17 14:06:37 +00:00
Родитель ba8b42634d
Коммит 191b610f5c
4 изменённых файлов: 16 добавлений и 52 удалений

Просмотреть файл

@ -2,7 +2,7 @@
<asp:Content ID="ContentHeaderContent" ContentPlaceHolderID="ContentHeaderPlaceholder" runat="server">
A list of all reported issues
A list of all reported outstanding issues
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="BodyContentPlaceHolder" runat="Server">
<asp:LoginView ID="LoginView1" runat="server">
@ -15,7 +15,7 @@
<%-- Need something in the filter here so it will actually filter at all --%>
<asp:SqlDataSource ID="IssuesSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MomaDB %>"
ProviderName="<%$ ConnectionStrings:MomaDB.ProviderName %>"
SelectCommand="SELECT c.apps, i.method_namespace, i.method_class, i.method_name, i.display_name, i.lookup_name FROM (SELECT COUNT(DISTINCT(report_id)) AS Apps, issue_id FROM issue_report GROUP BY issue_id) as c, (SELECT issue.id, issue.method_namespace, issue.method_class, issue.method_name, issue_type.display_name, issue_type.lookup_name FROM issue, issue_type WHERE issue_type.id = issue.issue_type_id) AS i WHERE c.issue_id = i.id ORDER BY apps DESC;"
SelectCommand="SELECT c.total, c.apps, c.total/c.apps AS totalperapp, i.method_namespace, i.method_class, i.method_name, i.display_name, i.lookup_name FROM (SELECT COUNT(report_id) AS total, COUNT(DISTINCT(report_id)) AS apps, issue_id FROM issue_report GROUP BY issue_id) as c, (SELECT issue.id, issue.method_namespace, issue.method_class, issue.method_name, issue_type.display_name, issue_type.lookup_name FROM issue, issue_type WHERE issue_type.id = issue.issue_type_id AND (issue.is_latest_definition = true OR issue_type.lookup_name = 'PINV')) AS i WHERE c.issue_id = i.id ORDER BY total DESC;"
CacheDuration="300" EnableCaching="True" FilterExpression="lookup_name = 'TODO'"
OnFiltering="IssuesSqlDataSource_Filtering">
</asp:SqlDataSource>
@ -42,7 +42,9 @@
<HeaderStyle CssClass="gv_header" />
<PagerStyle CssClass="gv_pager" />
<Columns>
<asp:BoundField DataField="Apps" HeaderText="Apps" SortExpression="apps" />
<asp:BoundField DataField="total" HeaderText="Count" SortExpression="total" />
<asp:BoundField DataField="apps" HeaderText="Apps" SortExpression="apps" />
<asp:BoundField DataField="totalperapp" HeaderText="Ratio" SortExpression="totalperapp" />
<asp:BoundField DataField="method_namespace" HeaderText="Namespace" SortExpression="method_namespace" />
<asp:BoundField DataField="method_class" HeaderText="Class" SortExpression="method_class" />
<asp:BoundField DataField="method_name" HeaderText="Method" SortExpression="method_name" />

Просмотреть файл

@ -133,29 +133,30 @@ public partial class APIReport : System.Web.UI.Page
brace_start = method.IndexOf('(');
brace_end = method.IndexOf(')');
/* This is all highly dependent on column order :( */
if (brace_start + 1 < brace_end)
{
/* Got some parameters */
e.Row.Cells[3].Text = method.Substring(0, brace_start + 1) + "...)";
e.Row.Cells[5].Text = method.Substring(0, brace_start + 1) + "...)";
}
e.Row.Cells[3].ToolTip = method;
e.Row.Cells[5].ToolTip = method;
if (e.Row.Cells[1].Text.Length > 25)
if (e.Row.Cells[3].Text.Length > 22)
{
e.Row.Cells[1].ToolTip = e.Row.Cells[1].Text;
e.Row.Cells[1].Text = e.Row.Cells[1].Text.Substring(0, 22) + "...";
e.Row.Cells[3].ToolTip = e.Row.Cells[3].Text;
e.Row.Cells[3].Text = e.Row.Cells[3].Text.Substring(0, 19) + "...";
}
if (e.Row.Cells[2].Text.Length > 25)
if (e.Row.Cells[4].Text.Length > 22)
{
e.Row.Cells[2].ToolTip = e.Row.Cells[2].Text;
e.Row.Cells[2].Text = e.Row.Cells[2].Text.Substring(0, 22) + "...";
e.Row.Cells[4].ToolTip = e.Row.Cells[4].Text;
e.Row.Cells[4].Text = e.Row.Cells[4].Text.Substring(0, 19) + "...";
}
if (e.Row.Cells[3].Text.Length > 25)
if (e.Row.Cells[5].Text.Length > 22)
{
/* Already done ToolTip for this column */
e.Row.Cells[3].Text = e.Row.Cells[3].Text.Substring(0, 22) + "...";
e.Row.Cells[5].Text = e.Row.Cells[5].Text.Substring(0, 19) + "...";
}
}
}

Просмотреть файл

@ -8,10 +8,6 @@
ProviderName="<%$ ConnectionStrings:MomaDB.ProviderName %>" SelectCommand="SELECT rep.id, rep.report_date, rep.reporter_name, def.display_name, meta.importance, rep.miss, rep.niex, rep.pinv, rep.todo, rep.total FROM moma_definition def, report rep, report_metadata meta WHERE rep.moma_definition_id = def.id AND rep.id = meta.report_id ORDER BY rep.report_date DESC LIMIT 20;"
EnableCaching="True" CacheDuration="300">
</asp:SqlDataSource>
<asp:SqlDataSource ID="MostNeededSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MomaDB %>"
ProviderName="<%$ ConnectionStrings:MomaDB.ProviderName %>" SelectCommand="SELECT c.reports, i.method_namespace, i.method_class, i.method_name, i.lookup_name FROM (SELECT COUNT(DISTINCT(report_id)) AS reports, issue_id FROM issue_report GROUP BY issue_id) as c, (SELECT issue.id, issue.method_namespace, issue.method_class, issue.method_name, issue_type.lookup_name FROM issue, issue_type WHERE issue_type.id = issue.issue_type_id AND issue.is_latest_definition = true) AS i WHERE c.issue_id = i.id ORDER BY reports DESC LIMIT 20;"
EnableCaching="True" CacheDuration="300">
</asp:SqlDataSource>
<asp:SqlDataSource ID="IssuesPerAppSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MomaDB %>"
ProviderName="<%$ ConnectionStrings:MomaDB.ProviderName %>" SelectCommand="SELECT total AS count FROM report;"
EnableCaching="True" CacheDuration="300">
@ -118,19 +114,4 @@
</asp:GridView>
</LoggedInTemplate>
</asp:LoginView>
<br />
<asp:Label ID="MostNeededLabel" runat="server" Text="<h3>Most needed API:</h3>"></asp:Label>
<br />
<asp:GridView ID="MostNeededGridView" runat="server" AutoGenerateColumns="False"
DataSourceID="MostNeededSqlDataSource" OnRowDataBound="MostNeededGridView_RowDataBound">
<AlternatingRowStyle CssClass="gv_col_alternating" />
<HeaderStyle CssClass="gv_header" />
<Columns>
<asp:BoundField DataField="method_namespace" HeaderText="Namespace" />
<asp:BoundField DataField="method_class" HeaderText="Class" />
<asp:BoundField DataField="method_name" HeaderText="Method" />
<asp:BoundField DataField="lookup_name" HeaderText="Type" />
<asp:BoundField DataField="reports" HeaderText="Reports" />
</Columns>
</asp:GridView>
</asp:Content>

Просмотреть файл

@ -95,24 +95,4 @@ public partial class Overview : System.Web.UI.Page
/* %2B is '+' which otherwise doesn't show up */
IssuesPerAppNowGraphImage.ImageUrl = "http://chart.apis.google.com/chart?chs=200x150&cht=p&chl=0|1-5|6-25|26%2B&chd=t:" + scale4 + "," + scale1 + "," + scale2 + "," + scale3;
}
protected void MostNeededGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
GridView gv = (GridView)sender;
if (e.Row.RowType == DataControlRowType.DataRow)
{
string method = DataBinder.Eval(e.Row.DataItem, "method_name").ToString();
int brace_start, brace_end;
brace_start = method.IndexOf('(');
brace_end = method.IndexOf(')');
if (brace_start + 1 < brace_end)
{
/* Got some parameters */
e.Row.Cells[2].Text = method.Substring(0, brace_start + 1) + "...)";
}
e.Row.Cells[2].ToolTip = method;
}
}
}