8 changed files with 473 additions and 51 deletions
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 25.02.2012 |
||||
* Time: 21:04 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using System.Reflection; |
||||
|
||||
using ICSharpCode.Reports.Core; |
||||
|
||||
namespace ICSharpCode.CodeQuality.Reporting |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BaseReport.
|
||||
/// </summary>
|
||||
public class BaseReport |
||||
{ |
||||
private const string reportDir = "Reporting"; |
||||
|
||||
public BaseReport(List <string> fileNames) |
||||
{ |
||||
|
||||
if (fileNames.Count > 0) |
||||
{ |
||||
this.FileNames = new List<string>(); |
||||
this.FileNames.AddRange(fileNames); |
||||
} |
||||
} |
||||
|
||||
protected string MakeReportFileName (string reportName) |
||||
{ |
||||
Uri uri = new Uri(Assembly.GetExecutingAssembly().GetName().CodeBase); |
||||
var fullname = uri.LocalPath; |
||||
return Path.GetDirectoryName(fullname) + Path.DirectorySeparatorChar + reportDir + Path.DirectorySeparatorChar + reportName; |
||||
} |
||||
|
||||
protected List<string> FileNames {get;private set;} |
||||
|
||||
public ReportSettings ReportSettings {get;set;} |
||||
} |
||||
} |
@ -0,0 +1,78 @@
@@ -0,0 +1,78 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 25.02.2012 |
||||
* Time: 21:17 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Collections.ObjectModel; |
||||
|
||||
using ICSharpCode.CodeQuality.Engine.Dom; |
||||
using ICSharpCode.Reports.Core; |
||||
|
||||
namespace ICSharpCode.CodeQuality.Reporting |
||||
{ |
||||
/// <summary>
|
||||
/// Description of Dependencyrepor.
|
||||
/// </summary>
|
||||
public class DependencyReport:BaseReport |
||||
{ |
||||
private const string overviewReport = "DependencyReport.srd"; |
||||
public DependencyReport(List<string> fileNames):base(fileNames) |
||||
{ |
||||
} |
||||
|
||||
public IReportCreator Run(ReadOnlyCollection<AssemblyNode> list) |
||||
{ |
||||
var reportFileName = MakeReportFileName(overviewReport); |
||||
var model = ReportEngine.LoadReportModel(reportFileName); |
||||
ReportSettings = model.ReportSettings; |
||||
var newList = MakeList (list); |
||||
|
||||
IReportCreator creator = ReportEngine.CreatePageBuilder(model,newList,null); |
||||
creator.BuildExportList(); |
||||
return creator; |
||||
} |
||||
|
||||
List <DependencyViewModel> MakeList (ReadOnlyCollection<AssemblyNode> list) |
||||
{ |
||||
AssemblyNode baseNode = list[0]; |
||||
var newList = new List<DependencyViewModel>(); |
||||
foreach (var element in list) { |
||||
var i = baseNode.GetUses(element); |
||||
if (i > 0) { |
||||
Console.WriteLine("{0} ref {1} times {2}",baseNode.Name,element.Name,i); |
||||
newList.Add(new DependencyViewModel() |
||||
{ |
||||
Node = baseNode, |
||||
References = element.Name |
||||
}); |
||||
} |
||||
} |
||||
return newList; |
||||
} |
||||
} |
||||
|
||||
|
||||
internal class DependencyViewModel |
||||
{ |
||||
public DependencyViewModel() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public AssemblyNode Node {get;set;} |
||||
|
||||
|
||||
public string Name |
||||
{ |
||||
get {return Node.Name;} |
||||
} |
||||
|
||||
public string References {get;set;} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,290 @@
@@ -0,0 +1,290 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<ReportModel> |
||||
<ReportSettings> |
||||
<ReportSettings> |
||||
<ReportName>DependencyReport</ReportName> |
||||
<ReportType>FormSheet</ReportType> |
||||
<BottomMargin>50</BottomMargin> |
||||
<TopMargin>50</TopMargin> |
||||
<LeftMargin>50</LeftMargin> |
||||
<RightMargin>50</RightMargin> |
||||
<PageSize>827, 1169</PageSize> |
||||
<Landscape>False</Landscape> |
||||
<GraphicsUnit>Millimeter</GraphicsUnit> |
||||
<Padding>5, 5, 5, 5</Padding> |
||||
<AvailableFieldsCollection /> |
||||
<SortColumnsCollection /> |
||||
<GroupColumnsCollection> |
||||
<GroupColumn> |
||||
<SortDirection>Ascending</SortDirection> |
||||
<ColumnName>Name</ColumnName> |
||||
<DataTypeName>System.String</DataTypeName> |
||||
</GroupColumn> |
||||
</GroupColumnsCollection> |
||||
<ParameterCollection /> |
||||
<SqlParameters /> |
||||
<ConnectionString /> |
||||
<CommandText /> |
||||
<CommandType>Text</CommandType> |
||||
<DataModel>FormSheet</DataModel> |
||||
<NoDataMessage>No Data for this Report</NoDataMessage> |
||||
<DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont> |
||||
<UseStandardPrinter>True</UseStandardPrinter> |
||||
</ReportSettings> |
||||
</ReportSettings> |
||||
<SectionCollection> |
||||
<BaseSection> |
||||
<Location>50, 50</Location> |
||||
<Size>727, 60</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>False</VisibleInReport> |
||||
<SectionOffset>0</SectionOffset> |
||||
<SectionMargin>0</SectionMargin> |
||||
<DrawBorder>False</DrawBorder> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<Items> |
||||
<BaseTextItem> |
||||
<Location>157, 3</Location> |
||||
<Size>414, 40</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<Font>Segoe UI, 18pt, style=Bold</Font> |
||||
<StringTrimming>None</StringTrimming> |
||||
<ContentAlignment>TopLeft</ContentAlignment> |
||||
<CanGrow>False</CanGrow> |
||||
<CanShrink>False</CanShrink> |
||||
<RTL>No</RTL> |
||||
<Text>SharpDevelop CodeQuality Analysis</Text> |
||||
<DrawBorder>False</DrawBorder> |
||||
<FrameColor>Black</FrameColor> |
||||
<ForeColor>Black</ForeColor> |
||||
<Name>BaseTextItem2147483637</Name> |
||||
</BaseTextItem> |
||||
</Items> |
||||
<FrameColor>Black</FrameColor> |
||||
<Name>ReportHeader</Name> |
||||
</BaseSection> |
||||
<BaseSection> |
||||
<Location>50, 125</Location> |
||||
<Size>727, 69</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>False</VisibleInReport> |
||||
<SectionOffset>0</SectionOffset> |
||||
<SectionMargin>0</SectionMargin> |
||||
<DrawBorder>False</DrawBorder> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<Items> |
||||
<BaseLineItem> |
||||
<Location>22, 47</Location> |
||||
<Size>660, 10</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<ForeColor>Black</ForeColor> |
||||
<FromPoint>10, 5</FromPoint> |
||||
<ToPoint>647, 5</ToPoint> |
||||
<StartLineCap>Flat</StartLineCap> |
||||
<EndLineCap>Flat</EndLineCap> |
||||
<DashLineCap>Flat</DashLineCap> |
||||
<DashStyle>Solid</DashStyle> |
||||
<Thickness>4</Thickness> |
||||
<Name>BaseLineItem1</Name> |
||||
</BaseLineItem> |
||||
<BaseTextItem> |
||||
<Location>222, 3</Location> |
||||
<Size>257, 26</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<Font>Microsoft Sans Serif, 15.75pt</Font> |
||||
<StringTrimming>None</StringTrimming> |
||||
<ContentAlignment>TopLeft</ContentAlignment> |
||||
<CanGrow>False</CanGrow> |
||||
<CanShrink>False</CanShrink> |
||||
<DataType>System.String</DataType> |
||||
<RTL>No</RTL> |
||||
<Text>Analysis Overview Report</Text> |
||||
<DrawBorder>False</DrawBorder> |
||||
<FrameColor>Black</FrameColor> |
||||
<ForeColor>Black</ForeColor> |
||||
<Name>Overview</Name> |
||||
</BaseTextItem> |
||||
<BaseTextItem> |
||||
<Location>563, 3</Location> |
||||
<Size>100, 26</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<Font>Segoe UI, 15.75pt</Font> |
||||
<StringTrimming>None</StringTrimming> |
||||
<ContentAlignment>TopLeft</ContentAlignment> |
||||
<CanGrow>False</CanGrow> |
||||
<CanShrink>False</CanShrink> |
||||
<RTL>No</RTL> |
||||
<Text>=Today()</Text> |
||||
<DrawBorder>False</DrawBorder> |
||||
<FrameColor>Black</FrameColor> |
||||
<ForeColor>ControlText</ForeColor> |
||||
<Name>BaseTextItem2147483638</Name> |
||||
</BaseTextItem> |
||||
</Items> |
||||
<FrameColor>Black</FrameColor> |
||||
<Name>ReportPageHeader</Name> |
||||
</BaseSection> |
||||
<BaseSection> |
||||
<Location>50, 209</Location> |
||||
<Size>727, 115</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>False</VisibleInReport> |
||||
<SectionOffset>0</SectionOffset> |
||||
<SectionMargin>0</SectionMargin> |
||||
<DrawBorder>False</DrawBorder> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<Items> |
||||
<BaseRowItem> |
||||
<Location>31, 72</Location> |
||||
<Size>641, 30</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<DrawBorder>False</DrawBorder> |
||||
<ForeColor>Black</ForeColor> |
||||
<FrameColor>Black</FrameColor> |
||||
<Items> |
||||
<BaseDataItem> |
||||
<Location>254, 4</Location> |
||||
<Size>156, 20</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<Font>Microsoft Sans Serif, 10pt</Font> |
||||
<StringTrimming>None</StringTrimming> |
||||
<ContentAlignment>TopLeft</ContentAlignment> |
||||
<CanGrow>False</CanGrow> |
||||
<CanShrink>False</CanShrink> |
||||
<RTL>No</RTL> |
||||
<Text>References</Text> |
||||
<DrawBorder>False</DrawBorder> |
||||
<FrameColor>Black</FrameColor> |
||||
<ForeColor>Black</ForeColor> |
||||
<ColumnName>References</ColumnName> |
||||
<Name>BaseDataItem2</Name> |
||||
</BaseDataItem> |
||||
</Items> |
||||
<AlternateBackColor /> |
||||
<ChangeBackColorEveryNRow>0</ChangeBackColorEveryNRow> |
||||
<Name>BaseRowItem1</Name> |
||||
</BaseRowItem> |
||||
<GroupHeader> |
||||
<Location>31, 22</Location> |
||||
<Size>641, 30</Size> |
||||
<BackColor>LightGray</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<DrawBorder>False</DrawBorder> |
||||
<ForeColor>Black</ForeColor> |
||||
<FrameColor>Black</FrameColor> |
||||
<Items> |
||||
<BaseTextItem> |
||||
<Location>254, 2</Location> |
||||
<Size>100, 20</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<Font>Microsoft Sans Serif, 10pt</Font> |
||||
<StringTrimming>None</StringTrimming> |
||||
<ContentAlignment>TopLeft</ContentAlignment> |
||||
<CanGrow>False</CanGrow> |
||||
<CanShrink>False</CanShrink> |
||||
<RTL>No</RTL> |
||||
<Text>References</Text> |
||||
<DrawBorder>False</DrawBorder> |
||||
<FrameColor>Black</FrameColor> |
||||
<ForeColor>Black</ForeColor> |
||||
<Name>BaseTextItem2147483636</Name> |
||||
</BaseTextItem> |
||||
<BaseDataItem> |
||||
<Location>12, 3</Location> |
||||
<Size>211, 20</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<Font>Microsoft Sans Serif, 10pt</Font> |
||||
<StringTrimming>None</StringTrimming> |
||||
<ContentAlignment>TopLeft</ContentAlignment> |
||||
<CanGrow>False</CanGrow> |
||||
<CanShrink>False</CanShrink> |
||||
<RTL>No</RTL> |
||||
<Text>BaseDataItem1</Text> |
||||
<DrawBorder>False</DrawBorder> |
||||
<FrameColor>Black</FrameColor> |
||||
<ForeColor>Black</ForeColor> |
||||
<ColumnName>Name</ColumnName> |
||||
<Name>BaseDataItem1</Name> |
||||
</BaseDataItem> |
||||
</Items> |
||||
<AlternateBackColor /> |
||||
<ChangeBackColorEveryNRow>0</ChangeBackColorEveryNRow> |
||||
<PageBreakOnGroupChange>False</PageBreakOnGroupChange> |
||||
<Name>GroupHeader1</Name> |
||||
</GroupHeader> |
||||
</Items> |
||||
<FrameColor>Black</FrameColor> |
||||
<Name>ReportDetail</Name> |
||||
</BaseSection> |
||||
<BaseSection> |
||||
<Location>50, 339</Location> |
||||
<Size>727, 60</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>False</VisibleInReport> |
||||
<SectionOffset>0</SectionOffset> |
||||
<SectionMargin>0</SectionMargin> |
||||
<DrawBorder>False</DrawBorder> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<Items> |
||||
<BaseTextItem> |
||||
<Location>31, 5</Location> |
||||
<Size>573, 20</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<Font>Segoe UI, 9.75pt</Font> |
||||
<StringTrimming>None</StringTrimming> |
||||
<ContentAlignment>TopLeft</ContentAlignment> |
||||
<CanGrow>False</CanGrow> |
||||
<CanShrink>False</CanShrink> |
||||
<RTL>No</RTL> |
||||
<Text>= Globals!ReportFolder + '\' + Globals!ReportName</Text> |
||||
<DrawBorder>False</DrawBorder> |
||||
<FrameColor>Black</FrameColor> |
||||
<ForeColor>ControlText</ForeColor> |
||||
<Name>BaseTextItem2147483641</Name> |
||||
</BaseTextItem> |
||||
<BaseTextItem> |
||||
<Location>622, 5</Location> |
||||
<Size>100, 20</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>True</VisibleInReport> |
||||
<Font>Microsoft Sans Serif, 10pt</Font> |
||||
<StringTrimming>None</StringTrimming> |
||||
<ContentAlignment>TopLeft</ContentAlignment> |
||||
<CanGrow>False</CanGrow> |
||||
<CanShrink>False</CanShrink> |
||||
<DataType>System.String</DataType> |
||||
<RTL>No</RTL> |
||||
<Text>=Globals!PageNumber</Text> |
||||
<DrawBorder>False</DrawBorder> |
||||
<FrameColor>Black</FrameColor> |
||||
<ForeColor>Black</ForeColor> |
||||
<Name>PageNumber1</Name> |
||||
</BaseTextItem> |
||||
</Items> |
||||
<FrameColor>Black</FrameColor> |
||||
<Name>ReportPageFooter</Name> |
||||
</BaseSection> |
||||
<BaseSection> |
||||
<Location>50, 414</Location> |
||||
<Size>727, 60</Size> |
||||
<BackColor>White</BackColor> |
||||
<VisibleInReport>False</VisibleInReport> |
||||
<SectionOffset>0</SectionOffset> |
||||
<SectionMargin>0</SectionMargin> |
||||
<DrawBorder>False</DrawBorder> |
||||
<PageBreakAfter>False</PageBreakAfter> |
||||
<Items /> |
||||
<FrameColor>Black</FrameColor> |
||||
<Name>ReportFooter</Name> |
||||
</BaseSection> |
||||
</SectionCollection> |
||||
</ReportModel> |
Loading…
Reference in new issue