Aragas/Bannerlord.MBOptionScreen

View on GitHub

Showing 16 of 162 total issues

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 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 CreateMultiTranslatable has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public static MultiSelectionInquiryData? CreateMultiTranslatable(string titleText, string descriptionText, List<InquiryElement> inquiryElements, bool isExitShown, int minSelectableOptionCount, int maxSelectableOptionCount, string affirmativeText, string negativeText, Action<List<InquiryElement>> affirmativeAction, Action<List<InquiryElement>> negativeAction) =>
Severity: Major
Found in src/MCM.UI/Utils/InquiryDataUtils.cs - About 1 hr to fix

    Method CreateMulti has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            public static MultiSelectionInquiryData? CreateMulti(string titleText, string descriptionText, List<InquiryElement> inquiryElements, bool isExitShown, int minSelectableOptionCount, int maxSelectableOptionCount, string affirmativeText, string negativeText, Action<List<InquiryElement>> affirmativeAction, Action<List<InquiryElement>> negativeAction)
    Severity: Major
    Found in src/MCM.UI/Utils/InquiryDataUtils.cs - About 1 hr to fix

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

              public static TextInquiryData? CreateTextTranslatable(string titleText, string text, bool isAffirmativeOptionShown, bool isNegativeOptionShown, string affirmativeText, string negativeText, Action<string> affirmativeAction, Action negativeAction) =>
      Severity: Major
      Found in src/MCM.UI/Utils/InquiryDataUtils.cs - About 1 hr to fix

        Method Create has 8 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)
        Severity: Major
        Found in src/MCM.UI/Utils/InquiryDataUtils.cs - About 1 hr to fix

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

                  public static TextInquiryData? CreateText(string titleText, string text, bool isAffirmativeOptionShown, bool isNegativeOptionShown, string affirmativeText, string negativeText, Action<string> affirmativeAction, Action negativeAction)
          Severity: Major
          Found in src/MCM.UI/Utils/InquiryDataUtils.cs - About 1 hr to fix

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

                    public static InquiryData? CreateTranslatable(string titleText, string text, bool isAffirmativeOptionShown, bool isNegativeOptionShown, string affirmativeText, string negativeText, Action affirmativeAction, Action negativeAction) =>
            Severity: Major
            Found in src/MCM.UI/Utils/InquiryDataUtils.cs - About 1 hr 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 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 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 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 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)

                          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
                              Severity
                              Category
                              Status
                              Source
                              Language