Aragas/Bannerlord.MBOptionScreen

View on GitHub

Showing 11 of 142 total issues

Method PerformMigration001 has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
Open

        private static void PerformMigration001()
        {
            static void MoveDirectory(string source, string target)
            {
                var sourcePath = source.TrimEnd('\\', ' ');
Severity: Minor
Found in src/MCM.Bannerlord/MCMImplementationSubModule.cs - About 3 hrs 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 PerformMigration002 has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
Open

        private static void PerformMigration002()
        {
            static void MoveDirectory(string source, string target)
            {
                var sourcePath = source.TrimEnd('\\', ' ');
Severity: Minor
Found in src/MCM.Bannerlord/MCMImplementationSubModule.cs - About 3 hrs 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 Create has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public static InquiryData? Create(string titleText, string text, bool isAffirmativeOptionShown, bool isNegativeOptionShown, string affirmativeText, string negativeText,
            Action affirmativeAction, Action negativeAction, string soundEventPath = "", float expireTime = 0f, Action? timeoutAction = null,
            Func<ValueTuple<bool, string>>? isAffirmativeOptionEnabled = null, Func<ValueTuple<bool, string>>? isNegativeOptionEnabled = null)
Severity: Major
Found in src/MCM.UI/Utils/InquiryDataUtils.cs - About 1 hr to fix

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

            public ISettingsPropertyGroupBuilder AddFloatingInteger(string id, string name, float minValue, float maxValue, IRef @ref, Action<ISettingsPropertyFloatingIntegerBuilder>? builder)

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

              ISettingsPropertyGroupBuilder AddFloatingInteger(string id, string name, float minValue, float maxValue, IRef @ref, Action<ISettingsPropertyFloatingIntegerBuilder>? builder);
      Severity: Minor
      Found in src/MCM.Abstractions/FluentBuilder/ISettingsPropertyGroupBuilder.cs - About 45 mins to fix

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

                ISettingsPropertyGroupBuilder AddInteger(string id, string name, int minValue, int maxValue, IRef @ref, Action<ISettingsPropertyIntegerBuilder>? builder);
        Severity: Minor
        Found in src/MCM.Abstractions/FluentBuilder/ISettingsPropertyGroupBuilder.cs - About 45 mins to fix

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

                  public ISettingsPropertyGroupBuilder AddInteger(string id, string name, int minValue, int maxValue, IRef @ref, Action<ISettingsPropertyIntegerBuilder>? builder)

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

                    ISettingsPropertyGroupBuilder AddDropdown(string id, string name, int selectedIndex, IRef @ref, Action<ISettingsPropertyDropdownBuilder>? builder);
            Severity: Minor
            Found in src/MCM.Abstractions/FluentBuilder/ISettingsPropertyGroupBuilder.cs - About 35 mins to fix

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

                      ISettingsPropertyGroupBuilder AddButton(string id, string name, IRef @ref, string content, Action<ISettingsPropertyButtonBuilder>? builder);
              Severity: Minor
              Found in src/MCM.Abstractions/FluentBuilder/ISettingsPropertyGroupBuilder.cs - About 35 mins to fix

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

                        public ISettingsPropertyGroupBuilder AddDropdown(string id, string name, int selectedIndex, IRef @ref, Action<ISettingsPropertyDropdownBuilder>? builder)

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

                          public ISettingsPropertyGroupBuilder AddButton(string id, string name, IRef @ref, string content, Action<ISettingsPropertyButtonBuilder>? builder)
                    Severity
                    Category
                    Status
                    Source
                    Language