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

feat: add assistant to edit hazard analysis user defined functions #1011

Merged
merged 4 commits into from
Feb 25, 2022

Conversation

weibullguy
Copy link
Collaborator

@weibullguy weibullguy commented Feb 25, 2022

Does this PR introduce a breaking change?

  • Yes
  • No

Describe the purpose of this pull request.

To add an assistant for entering user defined hazard analysis functions.

Describe how this was implemented.

Converted Similar Item user defined function editing assistant to a generic function edit assistant. Updated Similar Item work view to use the generic assistant. Added a button to the Hazard Analysis to call this generic assistant to edit user defined hazard analysis functions.

Describe any particular area(s) reviewers should focus on.

None

Provide any other pertinent information.

Closes #955

Pull Request Checklist

  • Code Style

    • Code is following code style guidelines.
  • Static Checks

    • Failing static checks are only applicable to code outside the scope of
      this PR.
  • Tests

    • At least one test for all newly created functions/methods?
  • Chores

    • Issue(s) have been raised for problem areas outside the scope of
      this PR. These problem areas have been decorated with an ISSUE: # comment.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 25, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.11%.

Quality metrics Before After Change
Complexity 1.31 ⭐ 1.61 ⭐ 0.30 👎
Method Length 89.83 🙂 91.75 🙂 1.92 👎
Working memory 4.33 ⭐ 5.33 ⭐ 1.00 👎
Quality 80.34% 80.23% -0.11% 👎
Other metrics Before After Change
Lines 1283 1153 -130
Changed files Quality Before Quality After Quality Change
src/ramstk/views/gtk3/assistants/init.py % % %
src/ramstk/views/gtk3/hazard_analysis/panel.py 81.44% ⭐ 81.81% ⭐ 0.37% 👍
src/ramstk/views/gtk3/hazard_analysis/view.py 86.32% ⭐ 78.46% ⭐ -7.86% 👎
src/ramstk/views/gtk3/similar_item/view.py 83.23% ⭐ 80.47% ⭐ -2.76% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
src/ramstk/views/gtk3/hazard_analysis/panel.py HazardsTreePanel.__init__ 0 ⭐ 1119 ⛔ 6 ⭐ 58.82% 🙂 Try splitting into smaller methods
src/ramstk/views/gtk3/hazard_analysis/view.py HazardsWorkView._do_request_edit_function 7 ⭐ 109 🙂 10 😞 60.90% 🙂 Extract out complex expressions
src/ramstk/views/gtk3/similar_item/view.py SimilarItemWorkView._do_request_edit_function 7 ⭐ 109 🙂 10 😞 60.90% 🙂 Extract out complex expressions
src/ramstk/views/gtk3/hazard_analysis/view.py HazardsWorkView.__init__ 0 ⭐ 142 😞 5 ⭐ 75.43% ⭐ Try splitting into smaller methods
src/ramstk/views/gtk3/similar_item/view.py SimilarItemWorkView.__init__ 0 ⭐ 126 😞 5 ⭐ 77.29% ⭐ Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@github-actions github-actions bot added bump: minor Issue or PR documents a new feature requiring a minor version bump. type: feature Issue or PR adds or requests new functionality. labels Feb 25, 2022
@weibullguy weibullguy self-assigned this Feb 25, 2022
@github-actions github-actions bot added the status: inprogress Issue or PR is open, milestoned, and assigned. label Feb 25, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 25, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@weibullguy weibullguy changed the title feature: add assistant to edit hazard analysis user defined functions feat: add assistant to edit hazard analysis user defined functions Feb 25, 2022
@weibullguy weibullguy added the priority: normal Issue or PR is normal priority. label Feb 25, 2022
@codecov
Copy link

codecov bot commented Feb 25, 2022

Codecov Report

Merging #1011 (2dfe413) into master (29b52b2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1011   +/-   ##
=======================================
  Coverage   94.94%   94.94%           
=======================================
  Files         185      185           
  Lines        5339     5339           
  Branches      509      509           
=======================================
  Hits         5069     5069           
  Misses        235      235           
  Partials       35       35           
Flag Coverage Δ
3.6 94.94% <ø> (ø)
3.7 94.94% <ø> (ø)
3.8 94.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

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

@weibullguy weibullguy merged commit 86845ad into master Feb 25, 2022
@weibullguy weibullguy deleted the feature/issue-955 branch February 25, 2022 02:29
@trafico-bot trafico-bot bot added the endgame: merged Pull Request has been merged successfully label Feb 25, 2022
@weibullguy weibullguy added status: closed Pull Request is complete and integrated or closed for anther reason. and removed status: inprogress Issue or PR is open, milestoned, and assigned. labels Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump: minor Issue or PR documents a new feature requiring a minor version bump. endgame: merged Pull Request has been merged successfully priority: normal Issue or PR is normal priority. status: closed Pull Request is complete and integrated or closed for anther reason. type: feature Issue or PR adds or requests new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No assistant to enter user-defined FHA functions
1 participant