fremag/MemoScope.Net

View on GitHub

Showing 76 of 126 total issues

Method SymFindFileInPath has 10 arguments (exceeds 4 allowed). Consider refactoring.
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)
Severity: Major
Found in MemoScope/Core/Dac/DacFinder32.cs - About 1 hr to fix

    Method SymFindFileInPath32 has 10 arguments (exceeds 4 allowed). Consider refactoring.
    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);
    Severity: Major
    Found in MemoScope/Core/Dac/DacFinder32.cs - About 1 hr to fix

      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

        Method GetIPAddress has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private static IPAddress GetIPAddress(ClrObject ipAddress)
                {
                    const int AddressFamilyInterNetworkV6 = 23;
                    const int IPv4AddressBytes = 4;
                    const int IPv6AddressBytes = 16;
        Severity: Minor
        Found in MemoScope/Core/Data/SimpleValueHelper.cs - About 1 hr to fix

          Method Compare has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public int Compare(object x, object y)
                  {
                      if( sortOrder == SortOrder.None)
                      {
                          return 0;
          Severity: Minor
          Found in MemoScope/Modules/DumpDiff/DumpDiffModule.cs - About 1 hr to fix

            Method GetBlockingObjects has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public List<BlockingObject> GetBlockingObjects()
                    {
                        List<BlockingObject> blockingObjects = new List<BlockingObject>();
                        CancellationTokenSource source = new CancellationTokenSource();
                        var token = source.Token;
            Severity: Minor
            Found in MemoScope/Core/ClrDump.cs - About 1 hr to fix

              Method GetClrRoots has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public List<ClrRoot> GetClrRoots()
                      {
                          List<ClrRoot> clrRoots = new List<ClrRoot>();
                          CancellationTokenSource source = new CancellationTokenSource();
                          var token = source.Token;
              Severity: Minor
              Found in MemoScope/Core/ClrDump.cs - About 1 hr to fix

                Method MemoScope_Load has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private void MemoScope_Load(object sender, System.EventArgs e)
                        {
                            InitModuleFactory();
                            UIServiceHelper.InitServices(msgBus);
                            AddToolBar("Dump", 1, Properties.Resources.database_green);
                Severity: Minor
                Found in MemoScope/MemoScopeForm.cs - About 1 hr to fix

                  Method GetItems has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public static List<AbstractDumpExplorerData> GetItems(string mainDir)
                          {
                              List<AbstractDumpExplorerData> items = new List<AbstractDumpExplorerData>();
                              if (! Directory.Exists(mainDir))
                              {
                  Severity: Minor
                  Found in MemoScope/Modules/Explorer/AbstractDumpExplorerData.cs - About 1 hr to fix

                    Method HandleMessage has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                    Open

                            public void HandleMessage(OpenDumpRequest openDumpRequest)
                            {
                                CancellationTokenSource source = new CancellationTokenSource();
                                var token = source.Token;
                                foreach (var fileInfo in openDumpRequest.FileInfos.Where(fi => fi != null))
                    Severity: Minor
                    Found in MemoScope/Services/DumpLoaderService.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 LoadTypeStat has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public List<ClrTypeStats> LoadTypeStat()
                            {
                                var list = new List<ClrTypeStats>();
                                SQLiteCommand cmd = new SQLiteCommand();
                                cmd.Connection = cxion;
                    Severity: Minor
                    Found in MemoScope/Core/Cache/ClrDumpCache.cs - About 1 hr to fix

                      Method FindShortestPath has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      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)
                                  {
                      Severity: Minor
                      Found in MemoScope/Modules/RootPath/RootPathAnalysis.cs - About 1 hr to fix

                        Method Load has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public static ClrDumpInfo Load(string dumpPath)
                                {
                                    ClrDumpInfo clrDumpInfo = null;
                                    string clrDumpInfoPath = GetClrDumpInfoPath(dumpPath);
                                    try
                        Severity: Minor
                        Found in MemoScope/Core/ProcessInfo/ClrDumpInfo.cs - About 1 hr to fix

                          Method FilterAddresses has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  private void FilterAddresses(CancellationToken token)
                                  {
                                      var addresses = AddressList.Addresses;
                                      int c = addresses.Count;
                                      const int batchSize = 1024;
                          Severity: Minor
                          Found in MemoScope/Modules/Instances/InstancesModule.cs - About 1 hr to fix

                            Method cbClock_CheckedChanged has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    private void cbClock_CheckedChanged(object sender, EventArgs e)
                                    {
                                        if (cbClock.Checked)
                                        {
                                            string timespanStr = cbPeriod.Text;
                            Severity: Minor
                            Found in MemoScope/Modules/Process/ProcessModule.cs - About 1 hr to fix

                              Method FindOwner has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      public static ulong FindOwner(ulong address, ClrDump clrDump, ClrType delegateType, ClrType arrayObjType, HashSet<ulong> visited)
                                      {
                                          if (visited.Contains(address))
                                          {
                                              return 0;
                              Severity: Minor
                              Found in MemoScope/Modules/Delegates/DelegatesAnalysis.cs - About 1 hr to fix

                                Method AddValue has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        private void AddValue(string name, string alias, string group, Func<ProcessWrapper, object> func, bool visible = false, string format = "{0:###,###,###,##0}", bool addSeries = true)
                                Severity: Major
                                Found in MemoScope/Modules/Process/ProcessInfoViewer.cs - About 50 mins to fix

                                  Method AddValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          private void AddValue(string name, string group, Func<ProcessWrapper, object> func, bool visible = false, string format = "{0:###,###,###,##0}", bool addSeries = true)
                                  Severity: Minor
                                  Found in MemoScope/Modules/Process/ProcessInfoViewer.cs - About 45 mins to fix

                                    Method FindOwner has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            public static ulong FindOwner(ulong address, ClrDump clrDump, ClrType delegateType, ClrType arrayObjType, HashSet<ulong> visited)
                                    Severity: Minor
                                    Found in MemoScope/Modules/Delegates/DelegatesAnalysis.cs - About 35 mins to fix

                                      Method Create has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              public static void Create(ClrDump clrDump, IAddressContainer addresses, UIModule parent, Action<InstancesMixedModule> postInit, string name = null)
                                      Severity: Minor
                                      Found in MemoScope/Modules/InstancesMixed/InstancesMixedModule.cs - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language