fremag/MemoScope.Net

View on GitHub

Showing 76 of 126 total issues

Method Analyse has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        internal static List<ArraysInformation> Analyse(ClrDump clrDump, MessageBus msgBus)
        {
            CancellationTokenSource token = new CancellationTokenSource();
            var arrays = new List<ArraysInformation>();
            msgBus.BeginTask("Analyzing arrays...", token);
Severity: Minor
Found in MemoScope/Modules/Arrays/ArraysAnalysis.cs - About 1 hr to fix

    Method CheckDumpTriggers has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            private void CheckDumpTriggers()
            {
                var activeTriggers = processTriggersControl.Triggers.Where(dt => dt.Active);
                if (!activeTriggers.Any())
                {
    Severity: Minor
    Found in MemoScope/Modules/Process/ProcessModule.cs - About 1 hr to fix

      Method StoreData has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              private void StoreData(CancellationToken token)
              {
                  BeginUpdate();
                  Dictionary<ClrType, ClrTypeStats> stats = new Dictionary<ClrType, ClrTypeStats>();
                  foreach (var address in ClrDump.Heap.EnumerateObjectAddresses())
      Severity: Minor
      Found in MemoScope/Core/Cache/ClrDumpCache.cs - About 1 hr 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 Run has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private void Run()
                  {
                      while (!stopRequested)
                      {
                          SimpleTask task;
          Severity: Minor
          Found in MemoScope/Core/SingleThreadWorker.cs - About 1 hr to fix

            Method Analyse has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            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);
            Severity: Minor
            Found in MemoScope/Modules/Strings/StringAnalysis.cs - About 1 hr to fix

              Method Setup has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public void Setup(ClrDump clrDump)
                      {
                          ClrDump = clrDump;
                          Icon = Properties.Resources.processor_small;
                          Name = $"#{clrDump.Id} - Threads";
              Severity: Minor
              Found in MemoScope/Modules/Threads/ThreadsModule.cs - About 1 hr to fix

                Method HandleMessage has 40 lines of code (exceeds 25 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

                  Method tspApplyfilter_Click has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  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>();
                  Severity: Minor
                  Found in MemoScope/Modules/Instances/InstancesModule.cs - About 1 hr to fix

                    Method AnalyzeRootPath has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public static List<RootPathInformation> AnalyzeRootPath(MessageBus msgBus, ClrDumpObject clrDumpObject)
                            {
                                ClrDump clrDump = clrDumpObject.ClrDump;
                                ulong address = clrDumpObject.Address;
                                CancellationTokenSource token = new CancellationTokenSource();
                    Severity: Minor
                    Found in MemoScope/Modules/RootPath/RootPathAnalysis.cs - About 1 hr to fix

                      Method GetSimpleValue has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      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.");
                      
                      
                      Severity: Minor
                      Found in MemoScope/Core/Data/SimpleValueHelper.cs - About 1 hr to fix

                        Method Run has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public override void Run()
                                {
                                    locks = new string[NbThreads];
                                    for (int i = 0; i < NbThreads; i++)
                                    {
                        Severity: Minor
                        Found in MemoDummy/LockedThreadScript.cs - About 1 hr to fix

                          Method Run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  public override void Run()
                                  {
                                      string lockB = "Lock_A";
                                      string lockA = "Lock_B";
                                      Thread thread = new Thread(() =>
                          Severity: Minor
                          Found in MemoDummy/DeadLockedThreadScript.cs - About 1 hr to fix

                            Method GetFuncName has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    internal static string GetFuncName(ClrElementType elementType)
                                    {
                                        switch(elementType)
                                        {
                                            case ClrElementType.Boolean:
                            Severity: Minor
                            Found in MemoScope/Modules/Instances/FieldAccessor.cs - About 1 hr to fix

                              Method Run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      public override void Run()
                                      {
                                          for(int i=0; i < N; i++)
                                          {
                                              Thread t = new Thread(() => DoSomething(i));
                              Severity: Minor
                              Found in MemoDummy/ThreadsScript.cs - About 1 hr to fix

                                Method LoadInstances has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        public List<ulong> LoadInstances(int typeId)
                                        {
                                            int nb = 0;
                                            string name = null;
                                            CancellationTokenSource token = null;
                                Severity: Minor
                                Found in MemoScope/Core/Cache/ClrDumpCache.cs - About 1 hr to fix

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

                                      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/DacFinder64.cs - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language