fremag/MemoScope.Net

View on GitHub
MemoScope/Core/Helpers/ObjectListViewHelpers.cs

Summary

Maintainability
F
3 days
Test Coverage

Method SetUpAddressColumn has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring.
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;
Severity: Minor
Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 6 hrs to fix

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

using BrightIdeasSoftware;
using MemoScope.Core.Data;
using MemoScope.Modules.InstanceDetails;
using MemoScope.Tools.RegexFilter;
using Microsoft.Diagnostics.Runtime;
Severity: Minor
Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 6 hrs to fix

    Method SetUpAddressColumn has 131 lines of code (exceeds 25 allowed). Consider refactoring.
    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;
    Severity: Major
    Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 5 hrs to fix

      Method SetUpTypeColumn has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public static void SetUpTypeColumn(this ObjectListView listView, OLVColumn col, UIClrDumpModule dumpModule=null, string suffix = null)
              {
                  listView.FormatCell += (sender, e) =>
                  {
                      if (e.Column == col)
      Severity: Major
      Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 2 hrs to fix

        Method AddSimpleValueColumn has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        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
        Severity: Minor
        Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 1 hr to fix

          Method SetUpTypeColumn has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
          Open

                  public static void SetUpTypeColumn(this ObjectListView listView, OLVColumn col, UIClrDumpModule dumpModule=null, string suffix = null)
                  {
                      listView.FormatCell += (sender, e) =>
                      {
                          if (e.Column == col)
          Severity: Minor
          Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 1 hr to fix

          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

                  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
          Severity: Minor
          Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 1 hr to fix

            Avoid too many return statements within this method.
            Open

                                        return bookmark.Comment;
            Severity: Major
            Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                     return clrDumpObject;
              Severity: Major
              Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return null;
                Severity: Major
                Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return tooltipGetter(column, modelObject);
                  Severity: Major
                  Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return null;
                    Severity: Major
                    Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return;
                      Severity: Major
                      Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return result;
                        Severity: Major
                        Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                                 return null;
                          Severity: Major
                          Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                return;
                            Severity: Major
                            Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                      return new ClrDumpType(dumpModule.ClrDump, type);
                              Severity: Major
                              Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                   return null;
                                Severity: Major
                                Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                      return;
                                  Severity: Major
                                  Found in MemoScope/Core/Helpers/ObjectListViewHelpers.cs - About 30 mins to fix

                                    There are no issues that match your filters.

                                    Category
                                    Status