Skip to content

Commit

Permalink
GSAGH-550: sonar cloud suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
SandeepArup committed Dec 23, 2024
1 parent eb2692c commit de2499b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions GsaGH/Helpers/Assembly/ModelAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ internal partial class ModelAssembly {
private GsaIntDictionary<Axis> _axes;
private GsaGuidIntListDictionary<GSAElement> _elements;
private GsaIntDictionary<GridLine> _gridLines;
private GsaModel _gsaModel;
private GsaGuidDictionary<EntityList> _lists;
private ConcurrentDictionary<int, ConcurrentBag<int>> memberElementRelationship;
private GsaGuidDictionary<Member> _members;
Expand Down Expand Up @@ -595,7 +594,6 @@ private void ReportWarningFromAddingGridSurfacesOrList(string mes, string troubl
private void SetupModel(GsaModel model, LengthUnit unit) {
model ??= new GsaModel();
_model = model.ApiModel;
_gsaModel = model;
_unit = unit;
_model.UiUnits().LengthLarge = UnitMapping.GetApiUnit(_unit);
UiUnits units = _model.UiUnits();
Expand Down
2 changes: 1 addition & 1 deletion GsaGH/Helpers/TaskHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void AddAnalysisTask(GsaAnalysisTask task, GsaModel model) {
public static void ImportAnalysisTask(GsaAnalysisTask task, ref GsaModel model) {
ReadOnlyDictionary<int, AnalysisTask> existingTasks = model.ApiModel.AnalysisTasks();
if (task != null && !existingTasks.Keys.Contains(task.Id)) {
int highestTask = existingTasks.Count();
int highestTask = existingTasks.Count;
var analysisCases = new Dictionary<int, AnalysisCase>();
foreach (GsaAnalysisCase analysisCase in task.Cases) {
analysisCases.Add(analysisCase.Id, new AnalysisCase(analysisCase.Name, analysisCase.Definition));
Expand Down
10 changes: 5 additions & 5 deletions GsaGH/Parameters/4_Analysis/GsaAnalysisTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

using GsaGH.Helpers;

using Rhino.Commands;

namespace GsaGH.Parameters {
/// <summary>
/// <para>An analysis task is a package of work for the solver. Thus we can have a static analysis task, a modal analysis task, etc. Each analysis task has one or more analysis case(s). The distinction is that the cases corresponds to result sets and define items such as loading (in the static case) while the task describes what the solver has to do. </para>
Expand All @@ -33,11 +35,9 @@ internal GsaAnalysisTask(AnalysisTask task, Model model) {
}
private void CreateCases(Model model) {
ReadOnlyDictionary<int, AnalysisCase> analysisCases = model.AnalysisCases();
foreach (int caseId in ApiTask.Cases) {
if (analysisCases.ContainsKey(caseId)) {
AnalysisCase analysisCase = model.AnalysisCases()[caseId];
Cases.Add(new GsaAnalysisCase(caseId, analysisCase.Name, analysisCase.Description));
}
foreach (int caseId in ApiTask.Cases.Where(x => analysisCases.ContainsKey(x))) {
AnalysisCase analysisCase = model.AnalysisCases()[caseId];
Cases.Add(new GsaAnalysisCase(caseId, analysisCase.Name, analysisCase.Description));
}
}
public override string ToString() {
Expand Down

0 comments on commit de2499b

Please sign in to comment.