hrntsm/Tunny

View on GitHub

Showing 185 of 198 total issues

Method PreferentialOptimization has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        private void PreferentialOptimization(int nBatch, dynamic storage, dynamic artifactBackend, out Parameter[] parameter, out TrialGrasshopperItems result, out StudyWrapper study)
Severity: Minor
Found in Tunny/Solver/Algorithm.cs - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if (target == $"Attr: {k}_{i}")
                                {
                                    return values[i];
                                }
    Severity: Major
    Found in Tunny/WPF/ViewModels/Output/AnalysisChartViewModel.cs - About 45 mins to fix

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

              private static void SetConstraintDataList(IGH_DataAccess DA, Dictionary<string, object> dict, int i, string key)
              {
                  var constraint = new List<double>();
                  if (DA.GetDataList(i, constraint))
                  {
      Severity: Minor
      Found in Tunny/Component/Obsolete/ConstructFishAttribute_v0_12_0.cs and 1 other location - About 45 mins to fix
      Tunny/Component/Operation/ConstructFishAttribute.cs on lines 85..92

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

      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 FishEgg FromBase64(string base64)
              {
                  byte[] bytes = Convert.FromBase64String(base64);
                  using (var ms = new MemoryStream(bytes))
                  {
      Severity: Minor
      Found in Tunny/Type/GH_FishEgg.cs and 1 other location - About 45 mins to fix
      Tunny/Type/GH_FishPrint.cs on lines 74..81

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

      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 3 locations. Consider refactoring.
      Open

              private void ParamChangedHandler(IGH_DocumentObject sender, GH_ObjectChangedEventArgs e)
              {
                  if (e.Type == GH_ObjectEventType.NickName)
                  {
                      if (sender.NickName.Length == 0)
      Severity: Major
      Found in Tunny/Component/Operation/ConstructFishAttribute.cs and 2 other locations - About 40 mins to fix
      Tunny/Component/Obsolete/ConstructFishAttribute_v0_11_1.cs on lines 177..190
      Tunny/Component/Obsolete/ConstructFishAttribute_v0_12_0.cs on lines 217..230

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

      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 3 locations. Consider refactoring.
      Open

              private void ParamChangedHandler(IGH_DocumentObject sender, GH_ObjectChangedEventArgs e)
              {
                  if (e.Type == GH_ObjectEventType.NickName)
                  {
                      if (sender.NickName.Length == 0)
      Severity: Major
      Found in Tunny/Component/Obsolete/ConstructFishAttribute_v0_11_1.cs and 2 other locations - About 40 mins to fix
      Tunny/Component/Obsolete/ConstructFishAttribute_v0_12_0.cs on lines 217..230
      Tunny/Component/Operation/ConstructFishAttribute.cs on lines 155..168

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

      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 3 locations. Consider refactoring.
      Open

              private void ParamChangedHandler(IGH_DocumentObject sender, GH_ObjectChangedEventArgs e)
              {
                  if (e.Type == GH_ObjectEventType.NickName)
                  {
                      if (sender.NickName.Length == 0)
      Severity: Major
      Found in Tunny/Component/Obsolete/ConstructFishAttribute_v0_12_0.cs and 2 other locations - About 40 mins to fix
      Tunny/Component/Obsolete/ConstructFishAttribute_v0_11_1.cs on lines 177..190
      Tunny/Component/Operation/ConstructFishAttribute.cs on lines 155..168

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

      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

      Consider simplifying this complex logical expression.
      Open

                  if (StudyNameItems.Count == 0 || SelectedStudyName == null ||
                      SelectedObjective == null || ObjectiveItems.Count == 0 ||
                      VariableItems.Count == 0 || !VariableItems.Any(v => v.IsSelected))
                  {
                      plotSettings = null;
      Severity: Major
      Found in Tunny/WPF/ViewModels/Visualize/ParallelCoordinateViewModel.cs - About 40 mins to fix

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

                [Fact]
                public void NoTargetColumnTest()
                {
                    var reader = new CsvReader("TestFile/ColumnsError.csv");
                    int[] result = reader.ReadSelectionCsv(CsvType.Dashboard);
        Severity: Minor
        Found in Tunny.CoreTests/Util/CsvReaderTests.cs and 1 other location - About 40 mins to fix
        Tunny.CoreTests/Util/CsvReaderTests.cs on lines 49..56

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

        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

                        {
                            for (int i = 0; i < strings.Length; i++)
                            {
                                string item = $"Attr: {k}_{i}";
                                XAxisItems.Add(item);
        Severity: Minor
        Found in Tunny/WPF/ViewModels/Output/AnalysisChartViewModel.cs and 1 other location - About 40 mins to fix
        Tunny/WPF/ViewModels/Output/AnalysisChartViewModel.cs on lines 162..169

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

        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 NoLineTest()
                {
                    var reader = new CsvReader("TestFile/empty.csv");
                    int[] result = reader.ReadSelectionCsv(CsvType.Dashboard);
        Severity: Minor
        Found in Tunny.CoreTests/Util/CsvReaderTests.cs and 1 other location - About 40 mins to fix
        Tunny.CoreTests/Util/CsvReaderTests.cs on lines 58..65

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

        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

                        {
                            for (int i = 0; i < values.Length; i++)
                            {
                                string item = $"Attr: {k}_{i}";
                                XAxisItems.Add(item);
        Severity: Minor
        Found in Tunny/WPF/ViewModels/Output/AnalysisChartViewModel.cs and 1 other location - About 40 mins to fix
        Tunny/WPF/ViewModels/Output/AnalysisChartViewModel.cs on lines 171..178

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

        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

                public static bool IsAutoOrPositiveInt(string input, bool includeZero)
                {
                    if (string.IsNullOrWhiteSpace(input))
                    {
                        return false;
        Severity: Minor
        Found in Tunny.Core/Input/InputValidator.cs and 1 other location - About 40 mins to fix
        Tunny.Core/Input/InputValidator.cs on lines 62..74

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

        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

                public static bool IsAutoOrPositiveDouble(string input, bool includeZero)
                {
                    if (string.IsNullOrWhiteSpace(input))
                    {
                        return false;
        Severity: Minor
        Found in Tunny.Core/Input/InputValidator.cs and 1 other location - About 40 mins to fix
        Tunny.Core/Input/InputValidator.cs on lines 21..33

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

        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 TellResultToOptuna has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                private void TellResultToOptuna(OptimizationHandlingInfo optInfo, Parameter[] parameter, int trialNum, TrialWrapper trial, TrialGrasshopperItems result)
        Severity: Minor
        Found in Tunny/Solver/Algorithm.cs - About 35 mins to fix

          Method PlotParamImportances has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  public static PlotlyFigure PlotParamImportances(StudyWrapper study, string objectiveName, int objectiveIndex, string[] variableNames, string evaluator)
          Severity: Minor
          Found in Optuna/Visualization/Visualization.cs - About 35 mins to fix

            Method TellCompleted has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    private void TellCompleted(OptimizationHandlingInfo optInfo, Parameter[] parameter, int trialNum, TrialWrapper trial, TrialGrasshopperItems result)
            Severity: Minor
            Found in Tunny/Solver/Algorithm.cs - About 35 mins to fix

              Function plot_cluster_nd has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def plot_cluster_nd(
              Severity: Minor
              Found in Optuna/Visualization/Python/plot_clustering.py - About 35 mins to fix

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

                                    {
                                        if (value.Contains("\""))
                                        {
                                            value = value.Replace("\"", "");
                                        }
                Severity: Minor
                Found in Optuna/Storage/RDB/Storage.cs and 1 other location - About 35 mins to fix
                Optuna/Storage/RDB/Storage.cs on lines 638..644

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

                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

                            {
                                if (value.Contains("\""))
                                {
                                    value = value.Replace("\"", "");
                                }
                Severity: Minor
                Found in Optuna/Storage/RDB/Storage.cs and 1 other location - About 35 mins to fix
                Optuna/Storage/RDB/Storage.cs on lines 628..634

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

                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