Fix warnings and refactor common standards#745
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…nings-commonstandard
# Conflicts: # src/MSDIAL5/MsdialCore/Algorithm/RetentionTimeCorrection.cs
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces compiler-warning noise and applies small refactors across the CommonStandard layer (structure-finding, lipidomics, proteomics, math, serialization, and parsers) to keep implementations consistent without intended behavior changes.
Changes:
- Removes unused
usings, variables, and exception identifiers across multiple CommonStandard components. - Normalizes some API usage (e.g.,
AdductIon.GetAdductIon(...)) and simplifies a few helper properties/implementations. - Trims down unused locals in several large computational methods to reduce warning noise and improve readability.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Common/CommonStandard/StructureFinder/Utility/XlogpCalculator.cs | Removes unused locals related to XlogP calculation setup. |
| src/Common/CommonStandard/StructureFinder/Mapper/MoleculeMapper.cs | Removes unused using and unused exception variable in a catch block. |
| src/Common/CommonStandard/StructureFinder/Descriptor/MassFragmentFingerprint.cs | Comments out several unused locals to silence warnings in large descriptor routines. |
| src/Common/CommonStandard/PugRestApiStandard/PubRestProtocol.cs | Removes unused fields/usings related to timing/threading. |
| src/Common/CommonStandard/Proteomics/Function/SequenceToSpec.cs | Removes unused usings and silences unused constant warnings. |
| src/Common/CommonStandard/Parser/MsFinderIniParser.cs | Switches adduct parsing to AdductIon.GetAdductIon(...). |
| src/Common/CommonStandard/Parser/AdductIonParser.cs | Removes an unused local variable in adduct content parsing. |
| src/Common/CommonStandard/MessagePack/LargeListMessagePack.cs | Cleans up usings/unused fields and simplifies resolver selection. |
| src/Common/CommonStandard/Mathematics/Statistics/StatisticsMathematics.cs | Removes unused vector locals in OPLS modeling code paths. |
| src/Common/CommonStandard/Mathematics/Mathematics/BasicMathematics.cs | Removes unused local and dead commented return in binomial coefficient code. |
| src/Common/CommonStandard/Lipidomics/SpectrumPeakGenerator.cs | Removes unused locals/usings in spectrum generation logic. |
| src/Common/CommonStandard/Lipidomics/SmilesInchikeyGenerator.cs | Removes unused members and simplifies a DTO-like class. |
| src/Common/CommonStandard/Lipidomics/PositionLevelChains.cs | Removes an unused field (and related blank line adjustment). |
| src/Common/CommonStandard/Lipidomics/MsmsCharacterization.cs | Comments out unused locals tied to already-commented diagnostic checks. |
| src/Common/CommonStandard/Lipidomics/LPGSpectrumGenerator.cs | Removes an unused local variable in spectrum generation. |
| src/Common/CommonStandard/Lipidomics/LPEOadSpectrumGenerator.cs | Removes an unused constant. |
| src/Common/CommonStandard/Lipidomics/LPEd5OadSpectrumGenerator.cs | Removes an unused constant. |
| src/Common/CommonStandard/Lipidomics/LPCd5OadSpectrumGenerator.cs | Removes unused using and an unused constant. |
| src/Common/CommonStandard/Lipidomics/LipoqualityRest.cs | Removes unused usings and unused exception variable in a catch block. |
| src/Common/CommonStandard/Lipidomics/LipidEieioMsmsCharacterization.cs | Comments out unused diagnostic threshold locals. |
| src/Common/CommonStandard/Lipidomics/HexCerLipidParser.cs | Comments out an unused regex pattern constant. |
| src/Common/CommonStandard/Lipidomics/EtherPCOadSpectrumGenerator.cs | Removes an unused constant. |
| src/Common/CommonStandard/Lipidomics/EidLipidsSpectrumGenerator.cs | Removes unused usings/constants and minor whitespace cleanup. |
| src/Common/CommonStandard/Lipidomics/ChainsIndeterminateState.cs | Removes an unused field. |
| src/Common/CommonStandard/Lipidomics/CeramideOadSpectrumGenerator.cs | Removes unused using and an unused constant. |
| src/Common/CommonStandard/FormulaGenerator/Parser/FormulaResultParcer.cs | Comments out unused version parsing logic in the “fast reader” path. |
| src/Common/CommonStandard/Algorithm/Scoring/MsScanMatching.cs | Removes unused locals in dot-product scoring routines. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
305
to
320
| using (var sr = new StreamReader(filePath, Encoding.ASCII)) { | ||
| var versionNum = 1; | ||
| //var versionNum = 1; | ||
| var isHeaderChecked = false; | ||
|
|
||
| while (sr.Peek() > -1) { | ||
| wkstr = sr.ReadLine(); | ||
|
|
||
| if (isHeaderChecked == false) { | ||
| if (wkstr.Contains("Version:")) { | ||
| var versionString = wkstr.Substring(wkstr.Split(':')[0].Length + 2).Trim(); | ||
| switch (versionString) { | ||
| case "2": versionNum = 2; break; | ||
| } | ||
| } | ||
| //if (wkstr.Contains("Version:")) { | ||
| // var versionString = wkstr.Substring(wkstr.Split(':')[0].Length + 2).Trim(); | ||
| // switch (versionString) { | ||
| // case "2": versionNum = 2; break; | ||
| // } | ||
| //} | ||
| isHeaderChecked = true; | ||
| } |
Comment on lines
36
to
40
| public static IFormatterResolver DefaultResolver { | ||
| get { | ||
| if (defaultResolver == null) | ||
| { | ||
| return StandardResolver.Instance; | ||
| } | ||
| return defaultResolver; | ||
| return StandardResolver.Instance; | ||
| } | ||
| } |
Comment on lines
6117
to
6119
| var ring5ID = -1; | ||
| var ring6ID = -1; | ||
| //var ring6ID = -1; | ||
| var targetRingID = -1; |
Comment on lines
+13
to
+17
| //private static double OH = 17.002739652; | ||
| private static double H = 1.00782503207; | ||
| private static double H2O = 18.010564684; | ||
| private static double Proton = 1.00727646688; | ||
| private static double Electron = 0.0005485799; | ||
| //private static double Electron = 0.0005485799; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR cleans up warning-related issues and refactors the common standards code for consistency and maintainability.
It focuses on reducing noisy compiler warnings, tightening up implementations across the shared CommonStandard layer, and aligning patterns in the affected code paths without changing the intended behavior.
Summary
Notes