Fixes #2731 Follow up on CoPilot suggestions#2749
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements code quality improvements suggested by CoPilot that were delayed from release 12.2 to 12.3. The changes include import statement reorganization, removal of unused code, whitespace cleanup, and one float comparison modification.
Changes:
- Reorganized import statements to follow C# conventions (System namespaces first, alphabetically ordered)
- Removed unused BouncyCastle import and cleaned up trailing whitespace
- Modified float zero comparison pattern from
== 0to0.0f.Equals() - Removed redundant variable assignment in Ruby build script
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/OSPSuite.Infrastructure.Import/Core/DataSource.cs | Reordered imports to System namespaces first, removed unused BouncyCastle import, cleaned up whitespace |
| src/OSPSuite.Core/Domain/Services/SensitivityAnalyses/SensitivityAnalysisRunResultCalculator.cs | Changed float zero comparison from == 0 to 0.0f.Equals() |
| rakefile.rb | Removed redundant intermediate variable str = in find_token method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/OSPSuite.Core/Domain/Services/SensitivityAnalyses/SensitivityAnalysisRunResultCalculator.cs
Outdated
Show resolved
Hide resolved
Greptile SummaryThis PR addresses CoPilot suggestions from the develop-to-main merge by improving code quality across multiple files. The main changes include:
Critical Issue Found: The zero comparison logic in Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as Client Code
participant QVU as QuantityValuesUpdater
participant RC as ResidualCalculator
participant SARC as SensitivityAnalysisRunResultCalculator
participant FE as FloatExtensions
participant DE as DoubleExtensions
Note over FE,DE: Renamed IsValid() → IsFinite()
Client->>QVU: Update parameter value
QVU->>DE: parameterValue.Value.IsFinite()
DE-->>QVU: Returns true if not NaN/Infinity
Client->>RC: Calculate residuals
RC->>FE: simulatedValue.IsFinite()
FE-->>RC: Returns true if not NaN/Infinity
RC->>FE: observedValue.IsFinite()
FE-->>RC: Returns true if not NaN/Infinity
Client->>SARC: Calculate PK sensitivity
SARC->>FE: defaultPKValue.IsFinite()
FE-->>SARC: Returns true if not NaN/Infinity
SARC->>SARC: Math.Abs(defaultPKValue) < float.Epsilon
Note over SARC: Zero check logic issue:<br/>Won't catch exact 0 values
|
src/OSPSuite.Core/Domain/Services/SensitivityAnalyses/SensitivityAnalysisRunResultCalculator.cs
Outdated
Show resolved
Hide resolved
src/OSPSuite.Core/Domain/Services/SensitivityAnalyses/SensitivityAnalysisRunResultCalculator.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/OSPSuite.Core/Domain/Services/SensitivityAnalyses/SensitivityAnalysisRunResultCalculator.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #2731 Follow up on CoPilot suggestions
Description
During merge from develop to main CoPilot had some suggestions but we did not want to rebuild the release binaries for these suggestions so we delayed until 12.3
Type of change
Please mark relevant options with an
xin the brackets.How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Reviewer checklist
Mark everything that needs to be checked before merging the PR.
This change requires a documentation updateabove is selectedScreenshots (if appropriate):
Questions (if appropriate):