Showing 123 of 131 total issues
Method Run
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
internal static void Run(object sender, DoWorkEventArgs e)
{
TLog.MethodStart();
s_worker = sender as BackgroundWorker;
Component = e.Argument as UIOptimizeComponentBase;
Method GetAllStudySummaries
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static StudySummary[] GetAllStudySummaries(IOptunaStorage storage)
{
Study[] studies = storage.GetAllStudies();
var studySummaries = new StudySummary[studies.Length];
for (int i = 0; i < studies.Length; i++)
Method GetAttrs
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void GetAttrs(Dictionary<string, object> attrs, SQLiteDataReader reader)
{
string key = reader.GetString(0);
string value = reader.GetString(1);
if (!string.IsNullOrEmpty(value) && value.Contains("[") && value.Contains("]"))
Method SetSliderValues
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void SetSliderValues(decimal[] parameters)
{
TLog.MethodStart();
int i = 0;
Similar blocks of code found in 2 locations. Consider refactoring. Open
private NSGAIIISampler GetNsga3Settings(NSGAIIISampler nsgaIII)
{
TLog.MethodStart();
nsgaIII.MutationProb = nsga3MutationProbCheckBox.Checked
? (double?)nsga3MutationProbUpDown.Value : null;
- 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 113.
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
private NSGAIISampler GetNsga2Settings(NSGAIISampler nsgaII)
{
TLog.MethodStart();
nsgaII.MutationProb = nsga2MutationProbCheckBox.Checked
? (double?)nsga2MutationProbUpDown.Value : null;
- 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 113.
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 ShowUIEndMessages
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static DialogResult ShowUIEndMessages(EndState endState, bool isMultiObjective)
{
TLog.MethodStart();
DialogResult dialogResult;
MessageBoxButtons button = isMultiObjective ? MessageBoxButtons.OK : MessageBoxButtons.YesNo;
Method SelectItemUnsafe
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void SelectItemUnsafe(int index)
{
if (index < 0 || index >= ListItems.Count)
{
return;
Similar blocks of code found in 3 locations. Consider refactoring. Open
optuna.visualization.plot_slice(
study,
params=["x", "y"],
target=lambda t: t.values[0],
- 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 42.
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 3 locations. Consider refactoring. Open
optuna.visualization.plot_contour(
study,
params=["x", "y"],
target=lambda t: t.values[0],
- 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 42.
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 3 locations. Consider refactoring. Open
optuna.visualization.plot_parallel_coordinate(
study, params=["x", "y"], target=lambda t: t.values[0], target_name=name
- 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 42.
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 ToComponentEndMessage
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void ToComponentEndMessage(Algorithm optimize)
{
TLog.MethodStart();
string message;
switch (optimize.EndState)
Method ToPython
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public dynamic ToPython(dynamic optuna, string storagePath, Dictionary<string, double> firstVariables)
{
Dictionary<string, double> x0 = UseFirstEggToX0 && firstVariables != null && firstVariables.Count > 0
? firstVariables
: null;
Method GetAllStudies
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Study.Study[] GetAllStudies()
{
using (var connection = new SQLiteConnection(_sqliteConnection.ToString()))
{
connection.Open();
Method SetOutputIndices
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private bool SetOutputIndices(OutputMode mode)
{
TLog.MethodStart();
bool result = true;
var indices = new List<int>();
Method SetArtifacts
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private bool SetArtifacts()
{
TLog.MethodStart();
Artifacts = new Artifact();
if (_component.Params.Input[3].SourceCount == 0)
Method AddVariablesToFishEgg
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void AddVariablesToFishEgg(IEnumerable<VariableBase> variables)
{
foreach (VariableBase variable in variables)
{
string name = variable.NickName;
Method ToString
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public override string ToString()
{
var sb = new StringBuilder();
foreach (KeyValuePair<string, object> attr in Value)
{
Similar blocks of code found in 2 locations. Consider refactoring. Open
public void Contour(string objectiveName, int objectiveIndex, string[] variableNames)
{
PyModule ps = Py.CreateScope();
ps.Exec(ReadFileFromResource.Text("Optuna.Visualization.Python.plot_contour.py"));
dynamic visualize = ps.Get("plot_contour");
- 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 102.
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 dynamic CreateNewTStorage(bool useInnerPythonEngine, Settings.Storage storageSetting)
{
TLog.MethodStart();
string sqlitePath = storageSetting.GetOptunaStoragePathByExtension();
if (useInnerPythonEngine)
- 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 102.
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