Showing 76 of 126 total issues
Method SymFindFileInPath
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected override bool SymFindFileInPath(IntPtr hProcess, string searchPath, string filename, uint id, uint two, uint three, uint flags, StringBuilder filePath, IntPtr callback, IntPtr context)
Method SymFindFileInPath32
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static extern bool SymFindFileInPath32(IntPtr hProcess, string searchPath, string filename, uint id, uint two, uint three, uint flags, StringBuilder filePath, IntPtr callback, IntPtr context);
Method AddSizeColumn
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void AddSizeColumn(this ObjectListView listView, Func<object, ulong> addressGetter, ClrDump dump, Func<object, ClrType> clrTypeGetter)
{
var col = new OLVColumn("Size", null)
{
Width = 60, TextAlign = HorizontalAlignment.Right
Method GetIPAddress
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static IPAddress GetIPAddress(ClrObject ipAddress)
{
const int AddressFamilyInterNetworkV6 = 23;
const int IPv4AddressBytes = 4;
const int IPv6AddressBytes = 16;
Method Compare
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public int Compare(object x, object y)
{
if( sortOrder == SortOrder.None)
{
return 0;
Method GetBlockingObjects
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public List<BlockingObject> GetBlockingObjects()
{
List<BlockingObject> blockingObjects = new List<BlockingObject>();
CancellationTokenSource source = new CancellationTokenSource();
var token = source.Token;
Method GetClrRoots
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public List<ClrRoot> GetClrRoots()
{
List<ClrRoot> clrRoots = new List<ClrRoot>();
CancellationTokenSource source = new CancellationTokenSource();
var token = source.Token;
Method MemoScope_Load
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void MemoScope_Load(object sender, System.EventArgs e)
{
InitModuleFactory();
UIServiceHelper.InitServices(msgBus);
AddToolBar("Dump", 1, Properties.Resources.database_green);
Method GetItems
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static List<AbstractDumpExplorerData> GetItems(string mainDir)
{
List<AbstractDumpExplorerData> items = new List<AbstractDumpExplorerData>();
if (! Directory.Exists(mainDir))
{
Method HandleMessage
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
Open
public void HandleMessage(OpenDumpRequest openDumpRequest)
{
CancellationTokenSource source = new CancellationTokenSource();
var token = source.Token;
foreach (var fileInfo in openDumpRequest.FileInfos.Where(fi => fi != null))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method LoadTypeStat
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public List<ClrTypeStats> LoadTypeStat()
{
var list = new List<ClrTypeStats>();
SQLiteCommand cmd = new SQLiteCommand();
cmd.Connection = cxion;
Method FindShortestPath
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static bool FindShortestPath(List<ulong> currentPath, ref List<ulong> bestPath, IClrDump clrDump)
{
if(logger.IsDebugEnabled) logger.Debug("FindShortestPath: currentPath: " + Str(currentPath)+", best: "+Str(bestPath));
if( bestPath != null && currentPath.Count >= bestPath.Count)
{
Method Load
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static ClrDumpInfo Load(string dumpPath)
{
ClrDumpInfo clrDumpInfo = null;
string clrDumpInfoPath = GetClrDumpInfoPath(dumpPath);
try
Method FilterAddresses
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void FilterAddresses(CancellationToken token)
{
var addresses = AddressList.Addresses;
int c = addresses.Count;
const int batchSize = 1024;
Method cbClock_CheckedChanged
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void cbClock_CheckedChanged(object sender, EventArgs e)
{
if (cbClock.Checked)
{
string timespanStr = cbPeriod.Text;
Method FindOwner
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static ulong FindOwner(ulong address, ClrDump clrDump, ClrType delegateType, ClrType arrayObjType, HashSet<ulong> visited)
{
if (visited.Contains(address))
{
return 0;
Method AddValue
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private void AddValue(string name, string alias, string group, Func<ProcessWrapper, object> func, bool visible = false, string format = "{0:###,###,###,##0}", bool addSeries = true)
Method AddValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private void AddValue(string name, string group, Func<ProcessWrapper, object> func, bool visible = false, string format = "{0:###,###,###,##0}", bool addSeries = true)
Method FindOwner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static ulong FindOwner(ulong address, ClrDump clrDump, ClrType delegateType, ClrType arrayObjType, HashSet<ulong> visited)
Method Create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void Create(ClrDump clrDump, IAddressContainer addresses, UIModule parent, Action<InstancesMixedModule> postInit, string name = null)