hrntsm/Tunny

View on GitHub

Showing 185 of 198 total issues

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void GpStartupTrialsTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsAutoOrPositiveInt(value, false) ? value : "AUTO";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void TpeEICandidateTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsPositiveInt(value, false) ? value : "24";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void TpeStartupTrialsTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsAutoOrPositiveInt(value, false) ? value : "AUTO";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Method RunSingleOptimizeStep has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
Open

        private TrialGrasshopperItems RunSingleOptimizeStep(OptimizationHandlingInfo optInfo, Parameter[] parameter, int trialNum, DateTime startTime)
        {
            TLog.MethodStart();
            dynamic optuna = Py.Import("optuna");
            TrialWrapper trial;
Severity: Minor
Found in Tunny/Solver/Algorithm.cs - About 35 mins to fix

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

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void TpeGammaTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsPositiveInt(value, false) ? value : "25";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void CmaEsSigma0TextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsAutoOrPositiveDouble(value, false) ? value : "AUTO";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void CmaEsPopulationSizeTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsPositiveInt(value, false) ? value : "1";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void GpOptunaStartupTrialsTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsAutoOrPositiveInt(value, false) ? value : "AUTO";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void CmaEsIncreasingPopulationSizeTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsPositiveInt(value, false) ? value : "2";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void TpePriorWeightTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsPositiveDouble(value, false) ? value : "1.0";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void MoCmaEsPopulationSizeTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsAutoOrPositiveInt(value, false) ? value : "AUTO";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MOEADSettingsPage.xaml.cs on lines 98..103
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 11 locations. Consider refactoring.
Open

        private void MoeadNeighborsTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var textBox = (TextBox)sender;
            string value = textBox.Text;
            textBox.Text = InputValidator.IsAutoOrPositiveInt(value, false) ? value : "AUTO";
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 87..92
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 94..99
Tunny/WPF/Views/Pages/Settings/Sampler/CmaEsSettingsPage.xaml.cs on lines 101..106
Tunny/WPF/Views/Pages/Settings/Sampler/GPBotorchSettingsPage.xaml.cs on lines 58..63
Tunny/WPF/Views/Pages/Settings/Sampler/GPOptunaSettingsPage.xaml.cs on lines 59..64
Tunny/WPF/Views/Pages/Settings/Sampler/MoCmaEsSettingsPage.xaml.cs on lines 57..62
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 75..80
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 82..87
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 89..94
Tunny/WPF/Views/Pages/Settings/Sampler/TPESettingsPage.xaml.cs on lines 96..101

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 65.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        [Fact]
        public void GetParetoFrontTrialTest()
        {
            Trial[] trials = _output.GetTargetTrial(new[] { -1 }, "output_test");
            Assert.Equal(2, trials.Length);
Severity: Minor
Found in Tunny.CoreTests/Solver/OutputTests.cs and 1 other location - About 35 mins to fix
Tunny.CoreTests/Solver/OutputTests.cs on lines 23..28

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 64.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                {
                    IEnumerable<double> values = pair.Value.Select(x => double.Parse(x, CultureInfo.InvariantCulture));
                    pyReportValues = PyConverter.EnumeratorToPyList(values);
                }
Severity: Minor
Found in Tunny/Solver/Algorithm.cs and 1 other location - About 35 mins to fix
Tunny/Solver/Algorithm.cs on lines 671..674

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 64.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    case JournalOperation.SetTrialUserAttr:
                        {
                            int trialId = (int)logObject["trial_id"];
                            var userAttr = (JObject)logObject["user_attr"];
                            SetTrialUserAttrFromJObject(trialId, userAttr);
Severity: Minor
Found in Optuna/Storage/Journal/Storage.cs and 1 other location - About 35 mins to fix
Optuna/Storage/Journal/Storage.cs on lines 181..187

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 64.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                {
                    IEnumerable<double> values = pair.Value.Select(x => double.Parse(x, CultureInfo.InvariantCulture));
                    pyReportValues = PyConverter.EnumeratorToPyList(values);
                }
Severity: Minor
Found in Tunny/Solver/Algorithm.cs and 1 other location - About 35 mins to fix
Tunny/Solver/Algorithm.cs on lines 656..659

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 64.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        [Fact]
        public void GetAllTargetTrialTest()
        {
            Trial[] trials = _output.GetTargetTrial(new[] { -10 }, "output_test");
            Assert.Equal(10, trials.Length);
Severity: Minor
Found in Tunny.CoreTests/Solver/OutputTests.cs and 1 other location - About 35 mins to fix
Tunny.CoreTests/Solver/OutputTests.cs on lines 16..21

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 64.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    case JournalOperation.SetTrialSystemAttr:
                        {
                            int trialId = (int)logObject["trial_id"];
                            var systemAttr = (JObject)logObject["system_attr"];
                            SetTrialSystemAttrFromJObject(trialId, systemAttr);
Severity: Minor
Found in Optuna/Storage/Journal/Storage.cs and 1 other location - About 35 mins to fix
Optuna/Storage/Journal/Storage.cs on lines 174..180

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 64.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        private static string ToBase64(FishEgg value)
        {
            using (var ms = new MemoryStream())
            {
                new BinaryFormatter().Serialize(ms, value);
Severity: Minor
Found in Tunny/Type/GH_FishEgg.cs and 1 other location - About 35 mins to fix
Tunny/Type/GH_FishPrint.cs on lines 83..90

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 63.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            string[] metricNames = version <= TEnvVariables.OldStorageVersion
                ? study.UserAttrs["objective_names"] as string[]
                : study.SystemAttrs["study:metric_names"] as string[];
Severity: Minor
Found in Tunny/Component/Optimizer/BoneFishComponent.cs and 1 other location - About 30 mins to fix
Tunny/WPF/ViewModels/Visualize/PlotSettingsViewModelBase.cs on lines 88..90

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 61.

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

Further Reading

Severity
Category
Status
Source
Language