Showing 77 of 198 total issues
File Algorithm.cs
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
File Storage.cs
has 600 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.IO;
using System.Linq;
File OptimizeViewModel.cs
has 550 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
File GrasshopperInOut.cs
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
File OutputViewModel.cs
has 454 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.Linq;
Method GetTargetValue
has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring. Open
Open
private double GetTargetValue(Trial trial, string target)
{
if (target == "ID")
{
return trial.TrialId;
- 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
File Storage.cs
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Class SqliteStorage
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class SqliteStorage : IOptunaStorage
{
private readonly Dictionary<int, Study.Study> _studies = new Dictionary<int, Study.Study>();
private readonly SQLiteConnectionStringBuilder _sqliteConnection;
private int _nextStudyId;
Class JournalStorage
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class JournalStorage : IOptunaStorage
{
private readonly Dictionary<int, Study.Study> _studies = new Dictionary<int, Study.Study>();
private int _nextStudyId;
private int _trialId;
Class Algorithm
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class Algorithm : PythonInit
{
public Parameter[] OptimalParameters { get; private set; }
public EndState EndState { get; private set; }
Method CreateBaseTables
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void CreateBaseTables()
{
var commands = new StringBuilder();
commands.Append("CREATE TABLE IF NOT EXISTS alembic_version(");
commands.Append(" version_num VARCHAR(32) PRIMARY KEY NOT NULL");
Method DrawTable
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void DrawTable()
{
var table = new DataTable();
table.Columns.Add("ID", typeof(int));
Method DrawTable
has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring. Open
Open
private void DrawTable()
{
var table = new DataTable();
table.Columns.Add("ID", typeof(int));
- 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
Class IOptunaStorage
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public interface IOptunaStorage
{
// Basic study manipulation
int CreateNewStudy(StudyDirection[] studyDirections, string studyName);
void DeleteStudy(int studyId);
Method ChangeTargetSampler
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void ChangeTargetSampler(SamplerType samplerType)
{
ITrialNumberParam param;
switch (samplerType)
{
Class GrasshopperInOut
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class GrasshopperInOut
{
private readonly GH_Document _document;
private readonly List<Guid> _inputGuids;
private readonly GH_Component _component;
File AnalysisChartViewModel.cs
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
Method RunSingleOptimizeStep
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private TrialGrasshopperItems RunSingleOptimizeStep(OptimizationHandlingInfo optInfo, Parameter[] parameter, int trialNum, DateTime startTime)
{
TLog.MethodStart();
dynamic optuna = Py.Import("optuna");
TrialWrapper trial;
Method SetStudyId
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
internal void SetStudyId(int studyId)
{
_selectedStudyId = studyId;
XAxisItems.Clear();
YAxisItems.Clear();
Method GetTargetValue
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private double GetTargetValue(Trial trial, string target)
{
if (target == "ID")
{
return trial.TrialId;