Showing 122 of 240 total issues
File TextureUtils.cs
has 1003 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
File Half.cs
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Diagnostics;
using System.Globalization;
namespace SystemHalf
File LauncherVMMixin.cs
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using Bannerlord.LauncherEx.Extensions;
using Bannerlord.LauncherEx.Helpers;
using Bannerlord.LauncherEx.ViewModels;
using Bannerlord.LauncherManager.Localization;
using Bannerlord.LauncherManager.Models;
File OpenSaveDialogs.cs
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
File BUTRLauncherOptionsVM.cs
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using Bannerlord.BUTR.Shared.Extensions;
using Bannerlord.LauncherEx.Helpers;
using Bannerlord.LauncherEx.Options;
using Bannerlord.LauncherManager.Localization;
Method RefreshLauncherOptions
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void RefreshLauncherOptions()
{
_launcherExData = new LauncherExData(
LauncherSettings.AutomaticallyCheckForUpdates,
LauncherSettings.FixCommonIssues,
Method ReadLine8bpp
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void ReadLine8bpp(SimpleBinaryStream input, PipelineWriter output, byte[] buffer)
{
var normalized = true;
switch (format)
{
Method Read
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public override void Read(PipelineWriter output)
{
var stream = new SimpleBinaryStream(dataSource);
switch (format)
{
Method ResolveHarmonyAssembliesFile
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static string? ResolveHarmonyAssembliesFile(AssemblyName assemblyName)
{
var assemblyNameFull = $"{assemblyName.Name}.dll";
var configName = Path.GetFileName(Directory.GetCurrentDirectory());
Method SplitCommandLine
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static IEnumerable<string> SplitCommandLine(string commandLine)
{
var startTokenIndex = 0;
var pos = 0;
Class TypeWrapper
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
Open
internal class TypeWrapper : Type
{
public override string Name { get; } = default!;
public override Guid GUID { get; } = default!;
public override Module Module { get; } = default!;
Class TypeWrapper
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
Open
internal class TypeWrapper : Type
{
public override string Name { get; } = default!;
public override Guid GUID { get; } = default!;
public override Module Module { get; } = default!;
Class BUTRInputManager
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
internal class BUTRInputManager : IInputManager, IDisposable
{
public readonly IInputManager InputManager;
public readonly int[] ReleasedChars = new int[10];
Method ReadLineFloat
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void ReadLineFloat(SimpleBinaryStream input, PipelineWriter output, float[] buffer)
{
switch (format)
{
case TextureFormat.R11G11B10F:
Method Enable
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void Enable()
{
ProgramPatch.Enable(_launcherHarmony);
UserDataManagerPatch.Enable(_launcherHarmony);
LauncherVMPatch.Enable(_launcherHarmony);
Method ShowDialog
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public override bool ShowDialog()
{
FileNames = null;
var file = Marshal.AllocHGlobal(MAX_FILE_LENGTH * Marshal.SystemDefaultCharSize);
Method ValidateSave
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void ValidateSave()
{
var changeset = _saveMetadata.GetChangeSet();
var modules = _saveMetadata.GetModules().Select(x =>
{
Method SplitCommandLine
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
Open
public static IEnumerable<string> SplitCommandLine(string commandLine)
{
var startTokenIndex = 0;
var pos = 0;
- 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 SaveLauncherOptions
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void SaveLauncherOptions()
{
if (_launcherExData is null)
return;
Method ReadLine16bpp
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void ReadLine16bpp(SimpleBinaryStream input, PipelineWriter output, ushort[] buffer)
{
var normalized = true;
switch (format)
{