Showing 122 of 240 total issues
Method ResolveLauncherExAssemblies
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static Assembly? ResolveLauncherExAssemblies(AssemblyName assemblyName)
{
var @namespace = "Bannerlord.BLSE.Shared.";
var resources = typeof(ModuleInitializer).Assembly.GetManifestResourceNames().Select(x => x.Remove(0, @namespace.Length));
var versions = resources.Where(x => x.StartsWith("Bannerlord.LauncherEx_")).Select(x =>
Method Transpiler
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[MethodImpl(MethodImplOptions.NoInlining)]
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var returnNull = new List<CodeInstruction>
{
Method Verify
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void Verify()
{
var assemblyFile = new FileInfo(typeof(GameConsistencyChecker).Assembly.Location);
var platform = assemblyFile.Directory!.Name;
Method Main
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void Main(string[] args)
{
//PInvoke.ShowWindow(PInvoke.GetConsoleWindow(), SHOW_WINDOW_CMD.SW_HIDE);
if (PlatformHelper.IsSteam())
Method SendNotification
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void SendNotification(string id, NotificationType type, string message, uint displayMs)
{
if (string.IsNullOrEmpty(id)) id = Guid.NewGuid().ToString();
// Prevents message spam
Method ReadBlock
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void ReadBlock(SimpleBinaryStream stream, byte[][] cache, int blockX)
{
var posX = blockX * 4;
var baseColor = new RGB565[4];
Method Main
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void Main(string[] args)
{
GameConsistencyChecker.Verify();
#if STANDALONE
Method PopulateVertices
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static void PopulateVertices(Texture texture, float screenX, float screenY, float[] outVertices, int verticesStartIndex, float scale, float customWidth, float customHeight)
Method GetMethodImpl
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => null;
Method GetPropertyImpl
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected override PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) => null;
Method GetMethodImpl
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) => null;
Method GetPropertyImpl
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected override PropertyInfo? GetPropertyImpl(string name, BindingFlags bindingAttr, Binder? binder, Type? returnType, Type[]? types, ParameterModifier[]? modifiers) => null;
Method RegQueryValueEx
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
internal static extern int RegQueryValueEx(RegistryHandle hKey, string lpValueName, int lpReserved, ref int lpType, [Out] byte[]? lpData, ref int lpcbData);
Method Show
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static MessageBoxResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton button, MessageBoxModal modal) =>
Method Show
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static MessageBoxResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton button, MessageBoxModal modal) =>
Method Write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void Write(string? value, IntPtr ptr, out int byteCnt, bool nullTerm = true, CharSet charSet = CharSet.Auto, long allocatedBytes = long.MaxValue)
Method Start
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
public void Start()
{
_isActive = true;
switch (ThreadConfig)
- Read upRead up
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 Show
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static MessageBoxResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton button, MessageBoxModal modal) =>
Method DecodeTextureDataToWriter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static void DecodeTextureDataToWriter(byte[] data, int width, int height, TextureFormat format, PipelineWriter writer, bool silentlyFail = false)
Method GetConstructorImpl
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected override ConstructorInfo? GetConstructorImpl(BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[] types, ParameterModifier[]? modifiers) => null;