Showing 240 of 240 total issues
File TextureUtils.cs
has 1003 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
Similar blocks of code found in 2 locations. Consider refactoring. Open
using System;
using System.Globalization;
using System.Reflection;
namespace Bannerlord.LauncherEx.Helpers;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 696.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
using System;
using System.Globalization;
using System.Reflection;
namespace Bannerlord.BLSE.Utils;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 696.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File Half.cs
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Diagnostics;
using System.Globalization;
namespace SystemHalf
Similar blocks of code found in 2 locations. Consider refactoring. Open
using Windows.Win32;
using Windows.Win32.Foundation;
using Windows.Win32.UI.WindowsAndMessaging;
namespace Bannerlord.LauncherEx.Helpers.Input;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 514.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
using Windows.Win32;
using Windows.Win32.Foundation;
using Windows.Win32.UI.WindowsAndMessaging;
namespace Bannerlord.BLSE.Shared.Utils;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 514.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File LauncherVMMixin.cs
has 446 lines of code (exceeds 250 allowed). Consider refactoring. 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
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
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
private void RefreshLauncherOptions()
{
_launcherExData = new LauncherExData(
LauncherSettings.AutomaticallyCheckForUpdates,
LauncherSettings.FixCommonIssues,
Similar blocks of code found in 2 locations. Consider refactoring. Open
public static Dictionary<string, string> GetGameOptions(Func<string, byte[]?> readFileContent)
{
var dict = new Dictionary<string, string>();
if (readFileContent(GameConfigPath) is not { } data) return dict;
try
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 267.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public static Dictionary<string, string> GetEngineOptions(Func<string, byte[]?> readFileContent)
{
var dict = new Dictionary<string, string>();
if (readFileContent(EngineConfigPath) is not { } data) return dict;
try
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 267.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method ReadLine8bpp
has 91 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
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
public static IEnumerable<string> SplitCommandLine(string commandLine)
{
var startTokenIndex = 0;
var pos = 0;
Class TypeWrapper
has 27 methods (exceeds 20 allowed). Consider refactoring. 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
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
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
private void ReadLineFloat(SimpleBinaryStream input, PipelineWriter output, float[] buffer)
{
switch (format)
{
case TextureFormat.R11G11B10F: