Showing 76 of 126 total issues
Method Analyse
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
internal static List<ArraysInformation> Analyse(ClrDump clrDump, MessageBus msgBus)
{
CancellationTokenSource token = new CancellationTokenSource();
var arrays = new List<ArraysInformation>();
msgBus.BeginTask("Analyzing arrays...", token);
Method CheckDumpTriggers
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void CheckDumpTriggers()
{
var activeTriggers = processTriggersControl.Triggers.Where(dt => dt.Active);
if (!activeTriggers.Any())
{
Method StoreData
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void StoreData(CancellationToken token)
{
BeginUpdate();
Dictionary<ClrType, ClrTypeStats> stats = new Dictionary<ClrType, ClrTypeStats>();
foreach (var address in ClrDump.Heap.EnumerateObjectAddresses())
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 Run
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void Run()
{
while (!stopRequested)
{
SimpleTask task;
Method Analyse
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
internal static List<StringInformation> Analyse(ClrDump clrDump, MessageBus msgBus)
{
var stringType = clrDump.GetClrType(typeof(string).FullName);
var stringInstances = clrDump.EnumerateInstances(stringType);
int nbStrings = clrDump.CountInstances(stringType);
Method Setup
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void Setup(ClrDump clrDump)
{
ClrDump = clrDump;
Icon = Properties.Resources.processor_small;
Name = $"#{clrDump.Id} - Threads";
Method HandleMessage
has 40 lines of code (exceeds 25 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))
Method tspApplyfilter_Click
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void tspApplyfilter_Click(object sender, EventArgs e)
{
var triggers = codeTriggersControl.Triggers.Where(trig => trig.Active).ToArray();
TypeRegistry reg = new TypeRegistry();
reg.RegisterType<DateTime>();
Method AnalyzeRootPath
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static List<RootPathInformation> AnalyzeRootPath(MessageBus msgBus, ClrDumpObject clrDumpObject)
{
ClrDump clrDump = clrDumpObject.ClrDump;
ulong address = clrDumpObject.Address;
CancellationTokenSource token = new CancellationTokenSource();
Method GetSimpleValue
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static object GetSimpleValue(ulong objAddress, ClrType clrType, bool isInterior=false)
{
if (objAddress == 0)
throw new NullReferenceException("ClrObject at is pointing to null address.");
Method Run
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public override void Run()
{
locks = new string[NbThreads];
for (int i = 0; i < NbThreads; i++)
{
Method Run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public override void Run()
{
string lockB = "Lock_A";
string lockA = "Lock_B";
Thread thread = new Thread(() =>
Method GetFuncName
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
internal static string GetFuncName(ClrElementType elementType)
{
switch(elementType)
{
case ClrElementType.Boolean:
Method Run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public override void Run()
{
for(int i=0; i < N; i++)
{
Thread t = new Thread(() => DoSomething(i));
Method LoadInstances
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public List<ulong> LoadInstances(int typeId)
{
int nb = 0;
string name = null;
CancellationTokenSource token = null;
Method SymFindFileInPath
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected abstract bool SymFindFileInPath(IntPtr hProcess, string searchPath, string filename, uint id, uint two, uint three, uint flags, StringBuilder filePath, IntPtr callback, IntPtr context);
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 SymFindFileInPath64
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static extern bool SymFindFileInPath64(IntPtr hProcess, string searchPath, string filename, uint id, uint two, uint three, uint flags, StringBuilder filePath, IntPtr callback, IntPtr context);
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)