MemoScope/Core/Helpers/ObjectListViewHelpers.cs
Method SetUpAddressColumn
has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring. Open
Open
public static void SetUpAddressColumn(this ObjectListView listView, OLVColumn col, UIClrDumpModule dumpModule, string suffix = null)
{
col.AspectToStringFormat = "{0:X}";
col.TextAlign = HorizontalAlignment.Right;
col.Width = 150;
- 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
File ObjectListViewHelpers.cs
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using BrightIdeasSoftware;
using MemoScope.Core.Data;
using MemoScope.Modules.InstanceDetails;
using MemoScope.Tools.RegexFilter;
using Microsoft.Diagnostics.Runtime;
Method SetUpAddressColumn
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void SetUpAddressColumn(this ObjectListView listView, OLVColumn col, UIClrDumpModule dumpModule, string suffix = null)
{
col.AspectToStringFormat = "{0:X}";
col.TextAlign = HorizontalAlignment.Right;
col.Width = 150;
Method SetUpTypeColumn
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void SetUpTypeColumn(this ObjectListView listView, OLVColumn col, UIClrDumpModule dumpModule=null, string suffix = null)
{
listView.FormatCell += (sender, e) =>
{
if (e.Column == col)
Method AddSimpleValueColumn
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void AddSimpleValueColumn(this ObjectListView listView, Func<object, ulong> addressGetter, ClrDump dump, Func<object, ClrType> typeGetter)
{
var col = new OLVColumn("Value", null)
{
Width = 150
Method SetUpTypeColumn
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
Open
public static void SetUpTypeColumn(this ObjectListView listView, OLVColumn col, UIClrDumpModule dumpModule=null, string suffix = null)
{
listView.FormatCell += (sender, e) =>
{
if (e.Column == col)
- 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 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
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return new ClrDumpType(dumpModule.ClrDump, type);
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return;
Avoid too many return
statements within this method. Open
Open
return;
Avoid too many return
statements within this method. Open
Open
return tooltipGetter(column, modelObject);
Avoid too many return
statements within this method. Open
Open
return;
Avoid too many return
statements within this method. Open
Open
return result;
Avoid too many return
statements within this method. Open
Open
return clrDumpObject;
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return bookmark.Comment;