Showing 56 of 131 total issues
Method GetAttributes
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public Dictionary<string, List<string>> GetAttributes()
{
TLog.MethodStart();
var attrs = new Dictionary<string, List<string>>();
if (_attributes.Value == null)
Method SetParamsValue
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static void SetParamsValue(List<IGH_Param> sources, List<double> numbers, List<Bitmap> images, List<GeometryBase> geometries)
{
TLog.MethodStart();
foreach (IGH_StructureEnumerator ghEnumerator in sources.Select(objective => objective.VolatileData.AllData(false)))
{
Method FilterInputVariables
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private bool FilterInputVariables()
{
TLog.MethodStart();
var errorInputGuids = new List<Guid>();
foreach ((IGH_DocumentObject docObject, int _) in _inputGuids.Select((guid, i) => (_document.FindObject(guid, false), i)))
Method SetTrialUserAttr
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static void SetTrialUserAttr(TrialGrasshopperItems result, dynamic trial, OptimizationHandlingInfo optSet)
{
TLog.MethodStart();
if (result.GeometryJson.Length != 0)
{
Method HumanSliderInputOptimization
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private void HumanSliderInputOptimization(int nBatch, double timeout, string[] directions, dynamic sampler, dynamic storage, dynamic artifactBackend, out Parameter[] parameter, out TrialGrasshopperItems result, out dynamic study)
Method NormalOptimization
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private void NormalOptimization(int nTrials, double timeout, string[] directions, dynamic sampler, dynamic storage, dynamic artifactBackend, out Parameter[] parameter, out TrialGrasshopperItems result, out dynamic study)
Method GetStudyDirections
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public StudyDirection[] GetStudyDirections(int studyId)
{
if (_studies.TryGetValue(studyId, out Study.Study value))
{
return value.Directions;
Function truncate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def truncate(fig, study: Study) -> go.Figure:
user_attr = study.trials[0].user_attrs
has_geometry = "Geometry" in user_attr
if has_geometry == False:
return fig
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method TTDesignExplorerToolStripMenuItem_Click
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void TTDesignExplorerToolStripMenuItem_Click(object sender, EventArgs e)
{
TLog.MethodStart();
string settingsPath = TEnvVariables.OptimizeSettingsPath;
string storagePath = string.Empty;
Method InstallPackages
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static void InstallPackages(BackgroundWorker worker, string[] packageList)
{
TLog.MethodStart();
int num = packageList.Length;
for (int i = 0; i < num; i++)
Method SetObjectives
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private bool SetObjectives()
{
TLog.MethodStart();
if (_component.Params.Input[1].SourceCount == 0)
{
Method CheckVariableSetsIsContained
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private bool CheckVariableSetsIsContained(IEnumerable<VariableBase> variables)
{
int sameValueCount = 0;
foreach (VariableBase variable in variables)
{
Method CreateStudy
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static dynamic CreateStudy(dynamic optuna, string studyName, dynamic sampler, string[] directions, dynamic storage, bool loadIfExists = true)
Method PreferentialOptimization
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private void PreferentialOptimization(int nBatch, dynamic storage, dynamic artifactBackend, out Parameter[] parameter, out TrialGrasshopperItems result, out dynamic study)
Function plot_cluster_nd
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_cluster_nd(
Function plot_pareto_front
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_pareto_front(