Skip to content

Fix warnings and refactor common standards#745

Merged
YukiMatsuzawa merged 20 commits into
masterfrom
refactor/fix-warnings-commonstandard
Jul 3, 2026
Merged

Fix warnings and refactor common standards#745
YukiMatsuzawa merged 20 commits into
masterfrom
refactor/fix-warnings-commonstandard

Conversation

@YukiMatsuzawa

Copy link
Copy Markdown
Contributor

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

  • Removes warning sources across CommonStandard and related shared utilities
  • Simplifies and normalizes implementations in the touched areas
  • Keeps the changes scoped to warning cleanup and refactoring work

Notes

  • The branch contains a broad set of mechanical updates across many files.
  • No source issue reference was provided, so there is nothing to close automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
@YukiMatsuzawa
YukiMatsuzawa merged commit 033064a into master Jul 3, 2026
10 checks passed
@YukiMatsuzawa
YukiMatsuzawa deleted the refactor/fix-warnings-commonstandard branch July 3, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants