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

Fix Coverity code smells in Profiles.ts #3029

Merged
merged 2 commits into from
Jul 31, 2024
Merged

Conversation

t1m0thyj
Copy link
Member

Proposed changes

Fixes 2 code smells detected by Coverity for nullable values

Release Notes

Milestone:

Changelog:

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Breaking change (a change that would cause existing functionality to not work as expected)
  • Documentation (Markdown, README updates)
  • Other (please specify above in "Proposed changes" section)

Checklist

General

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • All PR dependencies have been merged and published (if applicable)
  • A GIF or screenshot is included in the PR for visual changes
  • The pre-publish command has been executed:
    • v2 and below: yarn workspace vscode-extension-for-zowe vscode:prepublish
    • v3: pnpm --filter vscode-extension-for-zowe vscode:prepublish

Code coverage

  • There is coverage for the code that I have added
  • I have added new test cases and they are passing
  • I have manually tested the changes

Deployment

  • I have added developer documentation (if applicable)
  • Documentation should be added to Zowe Docs
    • If you're an outside contributor, please post in the #zowe-doc Slack channel to coordinate documentation.
    • Otherwise, please check with the rest of the squad about any needed documentation before merging.
  • These changes may need ported to the appropriate branches (list here):

Further comments

@t1m0thyj t1m0thyj added the no-changelog Add to PR's that don't require a CHANGELOG update label Jul 30, 2024
Copy link

codecov bot commented Jul 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.47%. Comparing base (6808cd9) to head (61beb69).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3029      +/-   ##
==========================================
+ Coverage   93.45%   93.47%   +0.01%     
==========================================
  Files         104      104              
  Lines       10986    10984       -2     
  Branches     2414     2311     -103     
==========================================
  Hits        10267    10267              
+ Misses        718      716       -2     
  Partials        1        1              

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

Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

This LGTM, thanks Timothy -- just a quick question regarding the original parameter type: Do we know why node was previously marked as optional? If we don't expect the function to be called without one, then this change is good to go - I was mostly curious to know if you had any insight on that 😋

Copy link

@t1m0thyj
Copy link
Member Author

This LGTM, thanks Timothy -- just a quick question regarding the original parameter type: Do we know why node was previously marked as optional? If we don't expect the function to be called without one, then this change is good to go - I was mostly curious to know if you had any insight on that 😋

I believe it may have been copied from other methods in Profiles.ts where the parameters are an optional node? or label?. But the only usage of this function is in the "Manage Profile" quickpick where a node should be defined.

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

LGTM! 😋
not sure why the node was optional in the first place 😋

@t1m0thyj t1m0thyj merged commit dfe9910 into main Jul 31, 2024
11 checks passed
@t1m0thyj t1m0thyj deleted the chore/fix-code-smells-v2 branch July 31, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Add to PR's that don't require a CHANGELOG update
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants