BUTR/Bannerlord.BLSE

View on GitHub
src/Bannerlord.LauncherEx/Helpers/Input/OpenSaveDialogs.cs

Summary

Maintainability
C
1 day
Test Coverage

File OpenSaveDialogs.cs has 407 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
Severity: Minor
Found in src/Bannerlord.LauncherEx/Helpers/Input/OpenSaveDialogs.cs - About 5 hrs to fix

    Method ShowDialog has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public override bool ShowDialog()
        {
            FileNames = null;
    
            var file = Marshal.AllocHGlobal(MAX_FILE_LENGTH * Marshal.SystemDefaultCharSize);
    Severity: Major
    Found in src/Bannerlord.LauncherEx/Helpers/Input/OpenSaveDialogs.cs - About 2 hrs to fix

      Class StringHelper has 22 methods (exceeds 20 allowed). Consider refactoring.
      Open

      file static class StringHelper
      {
          /// <summary>Allocates a block of memory allocated from the unmanaged COM task allocator sufficient to hold the number of specified characters.</summary>
          /// <param name="count">The number of characters, inclusive of the null terminator.</param>
          /// <param name="memAllocator">The method used to allocate the memory.</param>
      Severity: Minor
      Found in src/Bannerlord.LauncherEx/Helpers/Input/OpenSaveDialogs.cs - About 2 hrs to fix

        Method ShowDialog has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public override bool ShowDialog()
            {
                var fileName = Marshal.ReAllocCoTaskMem(Marshal.StringToCoTaskMemUni(FileName ?? string.Empty), MAX_FILE_LENGTH);
                //using var fileName = new SafeCoTaskMemString(FileName ?? string.Empty, MAX_FILE_LENGTH);
                //using var fileTitle = new SafeCoTaskMemString(MAX_FILE_LENGTH);
        Severity: Minor
        Found in src/Bannerlord.LauncherEx/Helpers/Input/OpenSaveDialogs.cs - About 1 hr to fix

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

              public static void Write(string? value, IntPtr ptr, out int byteCnt, bool nullTerm = true, CharSet charSet = CharSet.Auto, long allocatedBytes = long.MaxValue)
          Severity: Minor
          Found in src/Bannerlord.LauncherEx/Helpers/Input/OpenSaveDialogs.cs - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status