BUTR/Bannerlord.BLSE

View on GitHub

Showing 122 of 240 total issues

Method InvokeMember has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public override object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args, ParameterModifier[]? modifiers, CultureInfo? culture, string[]? namedParameters) => null;
Severity: Major
Found in src/Bannerlord.BLSE/Utils/TypeWrapper.cs - About 1 hr to fix

    Method InvokeMember has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public override object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args, ParameterModifier[]? modifiers, CultureInfo? culture, string[]? namedParameters) => null;
    Severity: Major
    Found in src/Bannerlord.LauncherEx/Helpers/TypeWrapper.cs - About 1 hr to fix

      Method SaveUserDataPostfix has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          [SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "<Pending>")]
          [SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "For Resharper")]
          [SuppressMessage("ReSharper", "InconsistentNaming")]
          [SuppressMessage("ReSharper", "RedundantAssignment")]
          [MethodImpl(MethodImplOptions.NoInlining)]
      Severity: Minor
      Found in src/Bannerlord.LauncherEx/Patches/UserDataManagerPatch.cs - About 1 hr to fix

        Method ReadLineDepth has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private void ReadLineDepth(SimpleBinaryStream input, PipelineWriter output, float[] depth, byte[] stencil)
                {
                    switch (format)
                    {
                        case TextureFormat.D24_UNORM_S8_UINT:
        Severity: Minor
        Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs - About 1 hr to fix

          Method DecodeTextureDataToWriter has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static void DecodeTextureDataToWriter(byte[] data, int width, int height, TextureFormat format, PipelineWriter writer, bool silentlyFail = false)
              {
                  if (!format.IsSupported())
                  {
                      if (!silentlyFail)
          Severity: Minor
          Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs - About 1 hr to fix

            Method ExecuteImport has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                [BUTRDataSourceMethod]
                public void ExecuteImport()
                {
                    if (ViewModel is null || _launcherModsVMMixin is null || UpdateAndSaveUserModsDataMethod is null) return;
            
            
            Severity: Minor
            Found in src/Bannerlord.LauncherEx/Mixins/LauncherVMMixin.cs - About 1 hr to fix

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

                      private static ushort[] GenerateBaseTable()
                      {
                          var baseTable = new ushort[512];
                          for (var i = 0; i < 256; ++i)
                          {
              Severity: Minor
              Found in src/Bannerlord.LauncherEx/TPac/Half.cs - About 1 hr 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 GenerateShiftTable has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private static sbyte[] GenerateShiftTable()
                          {
                              var shiftTable = new sbyte[512];
                              for (var i = 0; i < 256; ++i)
                              {
                  Severity: Minor
                  Found in src/Bannerlord.LauncherEx/TPac/Half.cs - About 1 hr to fix

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

                        [return: NotNullIfNotNull("value")]
                        private static string? ToSeparateWords(string? value)
                        {
                            if (value == null) return null;
                            if (value.Length <= 1) return value;
                    Severity: Minor
                    Found in src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherOptionsVM.cs - About 1 hr to fix

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

                          public static void CheckSteam()
                          {
                              static void Exit()
                              {
                                  MessageBoxDialog.Show("""
                      Severity: Minor
                      Found in src/Bannerlord.BLSE.Shared/Utils/UacHelper.cs - About 1 hr to fix

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

                            private void SetState()
                            {
                                if (ViewModel is null) return;
                        
                                OnPropertyChanged(nameof(IsSingleplayer2));
                        Severity: Minor
                        Found in src/Bannerlord.LauncherEx/Mixins/LauncherVMMixin.cs - About 1 hr to fix

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

                              private static unsafe string? InnerGet()
                              {
                                  var handle = (HGLOBAL) IntPtr.Zero;
                          
                                  var pointer = IntPtr.Zero;
                          Severity: Minor
                          Found in src/Bannerlord.LauncherEx/Helpers/Input/WindowsClipboard.cs - About 1 hr to fix

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

                                private static HarmonyDiscoveryResult TryResolveHarmonyAssembliesFileFromSteam(AssemblyName assemblyName, out string? path)
                                {
                                    path = null;
                                    var assemblyNameFull = $"{assemblyName.Name}.dll";
                            
                            
                            Severity: Minor
                            Found in src/Bannerlord.BLSE.Shared/Utils/HarmonyFinder.cs - About 1 hr to fix

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

                                      public static void ReadBC3AlphaBlock(long block, byte[][] cache, int posX, GetPixelMask writeMask)
                                      {
                                          writeMask(out var maskR, out var maskG, out var maskB, out var maskA,
                                              out var addR, out var addG, out var addB, out var addA);
                                          var alpha0 = (int) (block & 0xFF);
                              Severity: Minor
                              Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs - About 1 hr to fix

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

                                    public static void RegisterPatch(string movie, string? xpath, PrefabExtensionInsertAsSiblingPatch patch)
                                    {
                                        RegisterPatch(movie, xpath, node =>
                                        {
                                            var ownerDocument = node as XmlDocument ?? node.OwnerDocument;
                                Severity: Minor
                                Found in src/Bannerlord.LauncherEx/Helpers/UI/PrefabExtensionManager.cs - About 1 hr to fix

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

                                      private static HarmonyDiscoveryResult TryResolveHarmonyAssembliesFile(AssemblyName assemblyName, out string? path)
                                      {
                                          path = null;
                                          var assemblyNameFull = $"{assemblyName.Name}.dll";
                                  
                                  
                                  Severity: Minor
                                  Found in src/Bannerlord.BLSE.Shared/Utils/HarmonyFinder.cs - About 1 hr to fix

                                    Method TexImage2D2 has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        private static extern void TexImage2D2(uint target, int level, uint pixelInternalformat, int width, int height, int border, PixelFormat format, uint type, IntPtr pixels);
                                    Severity: Major
                                    Found in src/Bannerlord.LauncherEx/Extensions/OpenGLTextureExtensions.cs - About 1 hr to fix

                                      Method TexImage2D has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          private static extern void TexImage2D(uint target, int level, uint pixelInternalformat, int width, int height, int border, PixelFormat format, uint type, byte[] pixels);
                                      Severity: Major
                                      Found in src/Bannerlord.LauncherEx/Extensions/OpenGLTextureExtensions.cs - About 1 hr to fix

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

                                            public static bool Enable(Harmony harmony)
                                            {
                                                _harmony = harmony;
                                        
                                                var res1 = harmony.TryPatch(
                                        Severity: Minor
                                        Found in src/Bannerlord.LauncherEx/ResourceManagers/WidgetFactoryManager.cs - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language