Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing Periphery #58

Merged
merged 6 commits into from
Jan 23, 2025
Merged

Introducing Periphery #58

merged 6 commits into from
Jan 23, 2025

Conversation

jdisho
Copy link
Collaborator

@jdisho jdisho commented Jan 22, 2025

Introducing Periphery

♻️ Current situation & Problem

  • There was no tool for detecting unused code in the specified target.
  • The build-and-test workflow contains jobs that are outside its intended scope.
  • Merging Add LLM functionality from SpeziFHIR #53 left some code unused and with unnecessary access modifiers.

⚙️ Release Notes

  • Periphery will scan the specified target for unused code. This is the initial step towards addressing Remove All Dead Code & Cleanup Setup #56.
  • The CI pipeline is now split into two distinct workflows: build-and-test jobs for building and running the tests, and static-analysis jobs for code quality checks.
  • Resolved Periphery warnings.

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 43.83%. Comparing base (5a3b793) to head (f637d29).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
LLMonFHIR/FHIRSummary/FHIRResourceSummary.swift 42.86% 4 Missing ⚠️
LLMonFHIR/Settings/FHIRPrompt.swift 0.00% 4 Missing ⚠️
...ation/SingleResource/FHIRResourceInterpreter.swift 60.00% 2 Missing ⚠️
LLMonFHIR/Settings/FHIRPromptSettingsView.swift 0.00% 2 Missing ⚠️
...pleResources/FHIRMultipleResourceInterpreter.swift 0.00% 1 Missing ⚠️
.../MultipleResources/MultipleResourcesChatView.swift 0.00% 1 Missing ⚠️
LLMonFHIR/FHIRInterpretationModule.swift 66.67% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
+ Coverage   43.41%   43.83%   +0.43%     
==========================================
  Files          32       31       -1     
  Lines        1447     1424      -23     
==========================================
- Hits          628      624       -4     
+ Misses        819      800      -19     
Files with missing lines Coverage Δ
LLMonFHIR/FHIR Views/FHIRResourcesView.swift 85.14% <100.00%> (ø)
...LMonFHIR/FHIRSummary/FHIRResourceSummaryView.swift 44.27% <100.00%> (ø)
LLMonFHIR/Helper/FHIRStore+Interpretation.swift 48.72% <ø> (+1.22%) ⬆️
LLMonFHIR/Home.swift 72.73% <ø> (-0.80%) ⬇️
LLMonFHIR/LLMonFHIRDelegate.swift 100.00% <100.00%> (ø)
...pleResources/FHIRMultipleResourceInterpreter.swift 6.82% <0.00%> (ø)
.../MultipleResources/MultipleResourcesChatView.swift 0.00% <0.00%> (ø)
LLMonFHIR/FHIRInterpretationModule.swift 87.28% <66.67%> (ø)
...ation/SingleResource/FHIRResourceInterpreter.swift 81.82% <60.00%> (ø)
LLMonFHIR/Settings/FHIRPromptSettingsView.swift 0.00% <0.00%> (ø)
... and 2 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a3b793...f637d29. Read the comment docs.

@jdisho jdisho requested a review from PSchmiedmayer January 22, 2025 09:24
@jdisho jdisho self-assigned this Jan 22, 2025
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Thank you for working on all the elements here; the periphery setup looks good.

Happy to see this merged once the last few warnings have been resolved. I can recommend installing the tool locally as well, helps with identifying all the elements it is pointing out.

@PSchmiedmayer PSchmiedmayer added the enhancement New feature or request label Jan 22, 2025
@jdisho
Copy link
Collaborator Author

jdisho commented Jan 23, 2025

Thanks @PSchmiedmayer 🎉

Fyi, I resolved the warnings in two separate commits because I wasn't very sure why Periphery was flagging FHIRInterpretationModule, until I realised why and added a comment explaining why this is disabled there.

In the last commit I did a cleanup and in case we need some of this code in the future, we can reintroduce it.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Looks great; thank you! 🚀

@jdisho jdisho merged commit 7b5486f into main Jan 23, 2025
9 checks passed
@jdisho jdisho deleted the introduce-periphery-tool branch January 23, 2025 16:06
@jdisho jdisho mentioned this pull request Jan 23, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants