Aragas/Bannerlord.MBOptionScreen

View on GitHub

Showing 7 of 141 total issues

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

        public static InquiryDataWrapper? Create(string titleText,
            string text,
            bool isAffirmativeOptionShown,
            bool isNegativeOptionShown,
            string affirmativeText,
Severity: Major
Found in src/MCM/Utils/InquiryDataUtils.cs - About 1 hr to fix

    Method CopyProperties has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
    Open

            private void CopyProperties(bool clearOriginalProperties)
            {
                if (PropertyInfosField is not null && PropertyInfosField(Object) is { } propsObject && PropertyInfosField(this) is { } propsThis)
                {
                    if (clearOriginalProperties) propsThis.Clear(); // clear properties
    Severity: Minor
    Found in src/MCM/Abstractions/Common/ViewModelWrapper.cs - About 1 hr 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 SetValue has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            public override void SetValue(object? obj, object? value, BindingFlags invokeAttr, Binder? binder, object?[]? index, CultureInfo? culture)
    Severity: Major
    Found in src/MCM/Utils/WrappedPropertyInfo.cs - About 50 mins to fix

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

              public override object? GetValue(object? obj, BindingFlags invokeAttr, Binder? binder, object?[]? index, CultureInfo? culture) =>
      Severity: Minor
      Found in src/MCM/Utils/WrappedPropertyInfo.cs - About 45 mins to fix

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

                public static object? Create(TextObject item, Action<object> onExecute, object identifier, Func<Tuple<bool, TextObject>> getIsDisabledAndReason, bool isPositiveBehaviored = false)
        Severity: Minor
        Found in src/MCM/Utils/EscapeMenuItemVMUtils.cs - About 35 mins to fix

          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 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