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

Clean code by reducing warning and dead code #3139

Merged
merged 10 commits into from
Nov 8, 2024
Merged

Conversation

alkino
Copy link
Member

@alkino alkino commented Oct 21, 2024

Warning are for unused variables.
Dead code is the RCS_version and RCS_date that has not been updated since a really long time.

Copy link

✔️ 99bb35b -> Azure artifacts URL

Copy link
Member

@nrnhines nrnhines left a comment

Choose a reason for hiding this comment

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

I'm generally in favor of this. I reviewed the first 34 files but am not sure I did not make mistakes. What I notice is that occasionally an unused variable is used in a commented out line or false #if block. Generally for debugging. Or an error return is ignored. I wonder if these should be preserved for later decisions about what to do about them.

src/nrncvode/netcvode.cpp Outdated Show resolved Hide resolved
src/nrncvode/nrndaspk.cpp Show resolved Hide resolved
src/nrncvode/nrndaspk.cpp Show resolved Hide resolved
src/nrncvode/nrndaspk.cpp Show resolved Hide resolved
src/nrniv/multisend.cpp Outdated Show resolved Hide resolved
Copy link

✔️ 655a4f4 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 79.06977% with 9 lines in your changes missing coverage. Please review.

Project coverage is 67.07%. Comparing base (d3a3758) to head (7096ba0).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/nrncvode/nrndaspk.cpp 50.00% 4 Missing ⚠️
src/parallel/ocbbs.cpp 60.00% 2 Missing ⚠️
src/nrncvode/netcvode.cpp 50.00% 1 Missing ⚠️
src/oc/hoc_init.cpp 0.00% 1 Missing ⚠️
src/oc/hoc_oop.cpp 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3139   +/-   ##
=======================================
  Coverage   67.06%   67.07%           
=======================================
  Files         571      571           
  Lines      111318   111269   -49     
=======================================
- Hits        74658    74635   -23     
+ Misses      36660    36634   -26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

✔️ 4c2f419 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@alkino alkino changed the title Reduce warnings WIP: Reduce warnings Oct 30, 2024
Copy link

✔️ 185b496 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ d26ea08 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ b4789ad -> Azure artifacts URL

Copy link

✔️ c28c65b -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ 0393e3c -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ 9055679 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

sonarcloud bot commented Nov 8, 2024

@alkino alkino changed the title WIP: Reduce warnings Clean code by reducing warning and dead code Nov 8, 2024
Copy link

✔️ 7096ba0 -> Azure artifacts URL

@alkino alkino enabled auto-merge (squash) November 8, 2024 11:59
@alkino alkino merged commit 7f6d710 into master Nov 8, 2024
36 checks passed
@alkino alkino deleted the cornu/reduce_warnings branch November 8, 2024 16:42
@nrnhines
Copy link
Member

nrnhines commented Nov 8, 2024

Great job! I'm delighted this has been completed.
I looked through all these changes again and the only issue I noticed was that

void hoc_show_winio(void) {
    int b = (int) chkarg(1, 0., 1.);
#if defined(WIN32)
    hoc_winio_show(b);
#endif

would have one fewer warning if written as

void hoc_show_winio(void) {
#if defined(WIN32)
    int b = (int) chkarg(1, 0., 1.);
    hoc_winio_show(b);
#endif

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.

4 participants