BUTR/Bannerlord.BLSE

View on GitHub

Showing 240 of 240 total issues

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

    public static void Main(string[] args)
    {
        //PInvoke.ShowWindow(PInvoke.GetConsoleWindow(), SHOW_WINDOW_CMD.SW_HIDE);

        if (PlatformHelper.IsSteam())
Severity: Minor
Found in src/Bannerlord.BLSE.Shared/Program.cs - About 1 hr to fix

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

        public void SendNotification(string id, NotificationType type, string message, uint displayMs)
        {
            if (string.IsNullOrEmpty(id)) id = Guid.NewGuid().ToString();
    
            // Prevents message spam
    Severity: Minor
    Found in src/Bannerlord.LauncherEx/Adapters/NotificationProviderImpl.cs - About 1 hr to fix

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

              protected override void ReadBlock(SimpleBinaryStream stream, byte[][] cache, int blockX)
              {
                  var posX = blockX * 4;
      
                  var baseColor = new RGB565[4];
      Severity: Minor
      Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs - About 1 hr to fix

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

            public static void Main(string[] args)
            {
                GameConsistencyChecker.Verify();
        
        #if STANDALONE
        Severity: Minor
        Found in src/Bannerlord.BLSE.Loaders.Standalone/Program.cs - About 1 hr to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  var callbackGeneratedMethods = callbacksGeneratedTypes.SelectMany(AccessTools.GetDeclaredMethods)
                      .Where(x => !BlacklistedMethods.Contains(x.Name))
                      .Where(x => !BlacklistedMethodStarts.Any(y => x.Name.StartsWith(y)));
          src/Bannerlord.BLSE/Features/ExceptionInterceptor/FinalizerGlobal.cs on lines 49..51

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  var callbackGeneratedMethods = callbacksGeneratedTypes.SelectMany(AccessTools.GetDeclaredMethods)
                      .Where(x => !BlacklistedMethods.Contains(x.Name))
                      .Where(x => !BlacklistedMethodStarts.Any(y => x.Name.StartsWith(y)));
          src/Bannerlord.BLSE/Features/ExceptionInterceptor/FinalizerGlobal.cs on lines 39..41

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method PopulateVertices has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  private static void PopulateVertices(Texture texture, float screenX, float screenY, float[] outVertices, int verticesStartIndex, float scale, float customWidth, float customHeight)
          Severity: Major
          Found in src/Bannerlord.LauncherEx/ResourceManagers/SpriteDataManager.cs - About 1 hr to fix

            Method GetMethodImpl has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => null;
            Severity: Major
            Found in src/Bannerlord.LauncherEx/Helpers/TypeWrapper.cs - About 1 hr to fix

              Method GetPropertyImpl has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  protected override PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) => null;
              Severity: Major
              Found in src/Bannerlord.LauncherEx/Helpers/TypeWrapper.cs - About 1 hr to fix

                Method GetMethodImpl has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => null;
                Severity: Major
                Found in src/Bannerlord.BLSE/Utils/TypeWrapper.cs - About 1 hr to fix

                  Method GetPropertyImpl has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      protected override PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) => null;
                  Severity: Major
                  Found in src/Bannerlord.BLSE/Utils/TypeWrapper.cs - About 1 hr to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        private void SearchTextChanged()
                        {
                            var searchText = SearchText;
                            if (string.IsNullOrEmpty(searchText))
                            {
                    Severity: Minor
                    Found in src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherSavesVM.cs and 1 other location - About 55 mins to fix
                    src/Bannerlord.LauncherEx/Mixins/LauncherModsVMMixin.cs on lines 181..197

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 86.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        private void SearchTextChanged()
                        {
                            var searchText = SearchText;
                            if (string.IsNullOrEmpty(searchText))
                            {
                    Severity: Minor
                    Found in src/Bannerlord.LauncherEx/Mixins/LauncherModsVMMixin.cs and 1 other location - About 55 mins to fix
                    src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherSavesVM.cs on lines 85..101

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 86.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            foreach (var settingProperty in SettingProperties)
                            {
                                if (settingProperty.SettingPropertyDefinition is not ConfigSettingsPropertyDefinition propertyDefinition)
                                    continue;
                    
                    
                    Severity: Minor
                    Found in src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherOptionsVM.cs and 1 other location - About 55 mins to fix
                    src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherOptionsVM.cs on lines 320..329

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 85.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        [MethodImpl(MethodImplOptions.NoInlining)]
                        private static void LoadSubModulesPostfix()
                        {
                            OnLoadSubModulesPostfix?.Invoke();
                    
                    
                    Severity: Minor
                    Found in src/Bannerlord.BLSE/Features/Interceptor/Patches/ModulePatch.cs and 1 other location - About 55 mins to fix
                    src/Bannerlord.BLSE/Features/Interceptor/Patches/ModulePatch.cs on lines 35..43

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 85.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            foreach (var settingProperty in SettingProperties)
                            {
                                if (settingProperty.SettingPropertyDefinition is not ConfigSettingsPropertyDefinition propertyDefinition)
                                    continue;
                    
                    
                    Severity: Minor
                    Found in src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherOptionsVM.cs and 1 other location - About 55 mins to fix
                    src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherOptionsVM.cs on lines 345..354

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 85.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        [MethodImpl(MethodImplOptions.NoInlining)]
                        private static void InitializeSubModulesPrefix()
                        {
                            OnInitializeSubModulesPrefix?.Invoke();
                    
                    
                    Severity: Minor
                    Found in src/Bannerlord.BLSE/Features/Interceptor/Patches/ModulePatch.cs and 1 other location - About 55 mins to fix
                    src/Bannerlord.BLSE/Features/Interceptor/Patches/ModulePatch.cs on lines 45..53

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 85.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                    case TextureFormat.R8_UINT:
                                        for (int i = 0, j = 0; i < width; i++, j = i * 4)
                                        {
                                            buffer[j] = input.ReadByte();
                                            buffer[j + 3] = byte.MaxValue;
                    Severity: Minor
                    Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs and 1 other location - About 55 mins to fix
                    src/Bannerlord.LauncherEx/TPac/TextureUtils.cs on lines 447..455

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 84.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                    case TextureFormat.R16_UINT:
                                        for (int i = 0, j = 0; i < width; i++, j = i * 4)
                                        {
                                            buffer[j] = input.ReadUInt16();
                                            buffer[j + 3] = ushort.MaxValue;
                    Severity: Minor
                    Found in src/Bannerlord.LauncherEx/TPac/TextureUtils.cs and 1 other location - About 55 mins to fix
                    src/Bannerlord.LauncherEx/TPac/TextureUtils.cs on lines 357..365

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 84.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                        internal static extern int RegQueryValueEx(RegistryHandle hKey, string lpValueName, int lpReserved, ref int lpType, [Out] byte[]? lpData, ref int lpcbData);
                    Severity: Major
                    Found in src/Bannerlord.BLSE.Shared/Utils/RegistryHandle.cs - About 50 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language