hrntsm/Tunny

View on GitHub

Showing 56 of 131 total issues

Method CreateNewStudy has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public int CreateNewStudy(StudyDirection[] studyDirections, string studyName)
        {
            long maxLength;
            using (var connection = new SQLiteConnection(_sqliteConnection.ToString()))
            {
Severity: Minor
Found in Optuna/Storage/RDB/Storage.cs - About 1 hr to fix

    Method SetUIValues has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            private void SetUIValues()
            {
                TLog.MethodStart();
                TLog.Info("Set UI values");
                HumanInTheLoopType type = _component.GhInOut.Objectives.HumanInTheLoopType;
    Severity: Minor
    Found in Tunny/UI/OptimizationWindow.cs - About 1 hr to fix

      Method CreateFigure has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              private Visualization CreateFigure(dynamic study, Plot pSettings)
              {
                  TLog.MethodStart();
                  var visualize = new Visualization(study);
                  switch (pSettings.PlotTypeName)
      Severity: Minor
      Found in Tunny/Solver/Visualize.cs - About 1 hr to fix

        Method ToPython has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public dynamic ToPython(SamplerType type, string storagePath, bool hasConstraints, Dictionary<string, double> firstVariables)
                {
                    TLog.MethodStart();
                    dynamic optunaSampler;
                    dynamic optuna = Py.Import("optuna");
        Severity: Minor
        Found in Tunny.Core/Settings/Sampler.cs - About 1 hr to fix

          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;
          Severity: Minor
          Found in Tunny/Handler/OutputLoop.cs - About 1 hr to fix

            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++)
            Severity: Minor
            Found in Optuna/Study/Study.cs - About 1 hr to fix

              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("]"))
              Severity: Minor
              Found in Optuna/Storage/RDB/Storage.cs - About 1 hr to fix

                Method SetSliderValues has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private void SetSliderValues(decimal[] parameters)
                        {
                            TLog.MethodStart();
                            int i = 0;
                
                
                Severity: Minor
                Found in Tunny/Util/GrasshopperInOut.cs - About 1 hr to fix

                  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;
                  Severity: Minor
                  Found in Tunny/Solver/Solver.cs - About 1 hr to fix

                    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;
                    Severity: Minor
                    Found in Tunny/Component/Input/TunnyValueList.cs - About 1 hr to fix

                      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)
                      Severity: Minor
                      Found in Tunny/Solver/Solver.cs - About 1 hr to fix

                        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;
                        Severity: Minor
                        Found in Optuna/Sampler/CmaEsSampler.cs - About 1 hr to fix

                          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();
                          Severity: Minor
                          Found in Optuna/Storage/RDB/Storage.cs - About 1 hr to fix

                            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>();
                            Severity: Minor
                            Found in Tunny/UI/Tab/OutputTab.cs - About 1 hr to fix

                              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)
                              Severity: Minor
                              Found in Tunny/Util/GrasshopperInOut.cs - About 1 hr to fix

                                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;
                                Severity: Minor
                                Found in Tunny/Component/Operation/ConstructFishEgg.cs - About 1 hr to fix

                                  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)
                                              {
                                  Severity: Minor
                                  Found in Tunny/Type/GH_FishAttribute.cs - About 1 hr to fix

                                    Method GetParetoFrontTrials2D has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            private static Trial.Trial[] GetParetoFrontTrials2D(List<Trial.Trial> trials, StudyDirection[] directions)
                                            {
                                                List<Trial.Trial> targetTrials = trials.FindAll(trial => trial.State == TrialState.COMPLETE);
                                    
                                                int nTrials = targetTrials.Count;
                                    Severity: Minor
                                    Found in Optuna/Study/MultiObjective.cs - About 1 hr to fix

                                      Method CheckOptimizeComplete has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              private bool CheckOptimizeComplete(OptimizationHandlingInfo optInfo, int trialNum, DateTime startTime)
                                              {
                                                  TLog.MethodStart();
                                      
                                                  int nTrials = optInfo.NTrials;
                                      Severity: Minor
                                      Found in Tunny/Solver/Algorithm.cs - About 1 hr to fix

                                        Method SetAttributeEachItem has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                private void SetAttributeEachItem(StringBuilder sb, KeyValuePair<string, object> attr)
                                                {
                                                    var valueStrings = new StringBuilder();
                                                    if (attr.Key == "Geometry")
                                                    {
                                        Severity: Minor
                                        Found in Tunny/Type/GH_Fish.cs - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language