BUTR/Bannerlord.BLSE

View on GitHub

Showing 122 of 240 total issues

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 Load has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected virtual void Load(BinaryReader stream)
        {
            if (!stream.BaseStream.CanSeek)
                throw new IOException("The base stream must support random access (seek).");
            HeaderLoaded = true;
    Severity: Major
    Found in src/Bannerlord.LauncherEx/TPac/AssetPackage.cs - About 2 hrs to fix

      Method Enable has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static bool Enable(Harmony harmony)
          {
              PrefabExtensionManager.RegisterPatch(UILauncherPrefabExtension31.Movie, UILauncherPrefabExtension31.XPath, new UILauncherPrefabExtension31());
              PrefabExtensionManager.RegisterPatch(UILauncherPrefabExtension32.Movie, UILauncherPrefabExtension32.XPath, new UILauncherPrefabExtension32());
              PrefabExtensionManager.RegisterPatch(UILauncherPrefabExtension34.Movie, UILauncherPrefabExtension34.XPath, new UILauncherPrefabExtension34());
      Severity: Major
      Found in src/Bannerlord.LauncherEx/Patches/WidgetPrefabPatch.cs - About 2 hrs to fix

        File NETFrameworkLoader.Hosting.cs has 254 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #endif
        Severity: Minor
        Found in src/Bannerlord.BLSE.Loaders.Standalone/NETFrameworkLoader.Hosting.cs - About 2 hrs to fix

          Method SendDialog has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void SendDialog(DialogType type, string title, string message, IReadOnlyList<DialogFileFilter> filters, Action<string> onResult)
              {
                  switch (type)
                  {
                      case DialogType.Warning:
          Severity: Minor
          Found in src/Bannerlord.LauncherEx/Adapters/DialogProviderImpl.cs - About 2 hrs to fix

            Method ReadData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public override void ReadData(BinaryReader stream, IDictionary<object, object> userdata, int totalSize)
                {
                    int array = 1, mipmap = 1;
                    if (userdata.TryGetValue(KEY_ARRAY, out var arrayObj))
                    {
            Severity: Minor
            Found in src/Bannerlord.LauncherEx/TPac/TexturePixelData.cs - About 1 hr to fix

              Method GetArrays has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      protected override DrawObject2D GetArrays(SpriteDrawData spriteDrawData)
                      {
                          if (CachedDrawObject is not null && CachedDrawData == spriteDrawData)
                              return CachedDrawObject;
              
              
              Severity: Minor
              Found in src/Bannerlord.LauncherEx/ResourceManagers/SpriteDataManager.cs - About 1 hr to fix

                Method ReadLine32bpp has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private void ReadLine32bpp(SimpleBinaryStream input, PipelineWriter output, uint[] buffer)
                        {
                            var normalized = false;
                            switch (format)
                            {
                Severity: Minor
                Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs - About 1 hr to fix

                  Method BC3GradientInterpolate has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public static int BC3GradientInterpolate(int index, int alpha0, int alpha1, bool isFirstGreater)
                          {
                              if (isFirstGreater)
                              {
                                  switch (index)
                  Severity: Minor
                  Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs - About 1 hr to fix

                    Method TryLoadLoadOrderFromSaveFile has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static void TryLoadLoadOrderFromSaveFile(ref string[] args)
                        {
                            // If _MODULES_ arg is missing but a save file to load is specified, use the load order from the save file
                            var hasModules = false;
                            var saveFile = string.Empty;
                    Severity: Minor
                    Found in src/Bannerlord.BLSE.Shared/Standalone.cs - About 1 hr to fix

                      Method ResolveHarmonyAssembly has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static Assembly? ResolveHarmonyAssembly(AssemblyName assemblyName)
                          {
                              foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
                              {
                                  if (assembly.FullName == assemblyName.FullName)
                      Severity: Minor
                      Found in src/Bannerlord.BLSE.Shared/ModuleInitializer.cs - About 1 hr to fix

                        Method Read has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public override void Read(PipelineWriter output)
                                {
                                    var blockWidth = Math.Max((width + 3) / 4, 1);
                                    var blockHeight = Math.Max((height + 3) / 4, 1);
                                    var cache0 = new byte[4][];
                        Severity: Minor
                        Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs - About 1 hr to fix

                          Method Start has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public void Start()
                              {
                                  _isActive = true;
                          
                                  switch (ThreadConfig)
                          Severity: Minor
                          Found in src/Bannerlord.BLSE.Shared/NoExceptions/WindowsFrameworkEx.cs - About 1 hr to fix

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

                                [BUTRDataSourceMethod]
                                public void ExecuteUpdateCheck()
                                {
                                    try
                                    {
                            Severity: Minor
                            Found in src/Bannerlord.LauncherEx/Mixins/LauncherModsVMMixin.cs - About 1 hr to fix

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

                                  public override void ReadMetadata(BinaryReader stream, int totalSize)
                                  {
                                      var pos = stream.BaseStream.Position;
                                      var version = stream.ReadUInt32();
                                      stream.ReadGuid();
                              Severity: Minor
                              Found in src/Bannerlord.LauncherEx/TPac/Texture.cs - About 1 hr to fix

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

                                    protected override void RefreshState()
                                    {
                                        base.RefreshState();
                                        if (!OverrideDefaultStateSwitchingEnabled)
                                        {
                                Severity: Minor
                                Found in src/Bannerlord.LauncherEx/Widgets/LauncherToggleButtonWidget.cs - About 1 hr to fix

                                  Method InnerSet has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private static unsafe void InnerSet(string text)
                                      {
                                          PInvoke.EmptyClipboard();
                                          var hGlobal = (HGLOBAL) IntPtr.Zero;
                                          try
                                  Severity: Minor
                                  Found in src/Bannerlord.LauncherEx/Helpers/Input/WindowsClipboard.cs - About 1 hr to fix

                                    Method ExecuteStartGameOverride has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        [BUTRDataSourceMethod(OverrideName = "ExecuteStartGame")]
                                        public void ExecuteStartGameOverride(int mode)
                                        {
                                            if (ViewModel is null || ExecuteStartGame is null) return;
                                    
                                    
                                    Severity: Minor
                                    Found in src/Bannerlord.LauncherEx/Mixins/LauncherVMMixin.cs - About 1 hr to fix

                                      Method OnInitialStatePrefix has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private static bool OnInitialStatePrefix(MBSubModuleBase __instance)
                                          {
                                              static void FailedToLoad(string message)
                                              {
                                                  try

                                        Method OnAssemblyResolve has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private static Assembly? OnAssemblyResolve(object? sender, ResolveEventArgs args)
                                            {
                                                if (args.Name is null) return null;
                                        
                                                var name = new AssemblyName(args.Name);
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language