BUTR/Bannerlord.BLSE

View on GitHub

Showing 122 of 240 total issues

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

    protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) => null;
Severity: Minor
Found in src/Bannerlord.BLSE/Utils/TypeWrapper.cs - About 45 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if (FieldMapX is null || FieldMapY is null || FieldWidth is null || FieldHeight is null || FieldHorizontalFlip is null || FieldVerticalFlip is null)
                    return null!;
    Severity: Major
    Found in src/Bannerlord.LauncherEx/ResourceManagers/SpriteDataManager.cs - About 40 mins to fix

      Method TryOrderByLoadOrderTW has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public new bool TryOrderByLoadOrderTW(IEnumerable<string> loadOrder, Func<string, bool> isModuleSelected, [NotNullWhen(false)] out IReadOnlyList<string>? issues,
              out IReadOnlyList<IModuleViewModel> orderedModules, bool overwriteWhenFailure = false)
      Severity: Minor
      Found in src/Bannerlord.LauncherEx/BUTRLauncherManagerHandler.cs - About 35 mins to fix

        Method RegOpenKeyEx has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            internal static extern int RegOpenKeyEx(RegistryHandle hKey, string lpSubKey, int ulOptions, int samDesired, out RegistryHandle? hkResult);
        Severity: Minor
        Found in src/Bannerlord.BLSE.Shared/Utils/RegistryHandle.cs - About 35 mins to fix

          Method Show has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static MessageBoxResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton button) =>
          Severity: Minor
          Found in src/Bannerlord.LauncherEx/Helpers/Input/MessageBoxDialog.cs - About 35 mins to fix

            Method Show has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static MessageBoxResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton button) =>
            Severity: Minor
            Found in src/Bannerlord.BLSE/Utils/MessageBoxDialog.cs - About 35 mins to fix

              Method Show has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static MessageBoxResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton button) =>
              Severity: Minor
              Found in src/Bannerlord.BLSE.Shared/Utils/MessageBoxDialog.cs - About 35 mins to fix

                Method SendDialog has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Method Read has a Cognitive Complexity of 22 (exceeds 20 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 35 mins 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 RefreshState has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                  Open

                      protected override void RefreshState()
                      {
                          base.RefreshState();
                          if (!OverrideDefaultStateSwitchingEnabled)
                          {
                  Severity: Minor
                  Found in src/Bannerlord.LauncherEx/Widgets/LauncherToggleButtonWidget.cs - About 35 mins 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

                  Avoid too many return statements within this method.
                  Open

                          return true;
                  Severity: Major
                  Found in src/Bannerlord.LauncherEx/ResourceManagers/WidgetFactoryManager.cs - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return;
                    Severity: Major
                    Found in src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherOptionsVM.cs - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return ResolveLauncherExAssemblies(assemblyName);
                      Severity: Major
                      Found in src/Bannerlord.BLSE.Shared/ModuleInitializer.cs - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return true;

                          Avoid too many return statements within this method.
                          Open

                                  return null;
                          Severity: Major
                          Found in src/Bannerlord.BLSE/Features/AssemblyResolver/AssemblyResolverFeature.cs - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return true;
                            Severity: Major
                            Found in src/Bannerlord.LauncherEx/ResourceManagers/BrushFactoryManager.cs - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return null;
                              Severity: Major
                              Found in src/Bannerlord.BLSE.Loaders.LauncherEx/ModuleInitializer.cs - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return false;
                                Severity: Major
                                Found in src/Bannerlord.LauncherEx/Extensions/ViewModelExtensions.cs - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return null;
                                  Severity: Major
                                  Found in src/Bannerlord.BLSE.Shared/ModuleInitializer.cs - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return assembly;
                                    Severity: Major
                                    Found in src/Bannerlord.BLSE.Shared/ModuleInitializer.cs - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language