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 methods to remove existing failure modes #1068

Merged
merged 8 commits into from
May 13, 2022
Merged

Conversation

weibullguy
Copy link
Collaborator

@weibullguy weibullguy commented May 12, 2022

Does this PR introduce a breaking change?

  • Yes
  • No

Describe the purpose of this pull request.

To remove existing failure modes whenever a component's category or subcategory change.

Describe how this was implemented.

Added two methods to the FMEA panel to respond to category and subcategory changes. These are wrappers for the method that requests deletion of each mode and clearing the FMEA worksheet.

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

None

Provide any other pertinent information.

Closes #32

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.

@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 May 12, 2022
@weibullguy weibullguy added bump: patch Issue or PR documents a bug fix or enhancement requiring a patch version bump. and removed bump: minor Issue or PR documents a new feature requiring a minor version bump. labels May 12, 2022
@weibullguy weibullguy self-assigned this May 12, 2022
@github-actions github-actions bot added the status: inprogress Issue or PR is open, milestoned, and assigned. label May 12, 2022
@codecov
Copy link

codecov bot commented May 12, 2022

Codecov Report

Merging #1068 (9c39a66) into master (5e6bee6) will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1068      +/-   ##
==========================================
+ Coverage   95.46%   95.59%   +0.12%     
==========================================
  Files         155      155              
  Lines        5582     5586       +4     
  Branches      611      612       +1     
==========================================
+ Hits         5329     5340      +11     
+ Misses        226      221       -5     
+ Partials       27       25       -2     
Flag Coverage Δ
3.10 95.59% <100.00%> (+0.12%) ⬆️
3.7 95.59% <100.00%> (+0.12%) ⬆️
3.8 95.59% <100.00%> (+0.12%) ⬆️
3.9 95.59% <100.00%> (+0.12%) ⬆️

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

Impacted Files Coverage Δ
src/ramstk/models/dbtables/basetable.py 98.54% <ø> (-0.02%) ⬇️
src/ramstk/configuration.py 89.83% <100.00%> (+0.08%) ⬆️
src/ramstk/models/db/basedatabase.py 88.65% <100.00%> (+4.96%) ⬆️
src/ramstk/models/db/program_database.py 100.00% <100.00%> (ø)

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 5e6bee6...9c39a66. Read the comment docs.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 13, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.14%.

Quality metrics Before After Change
Complexity 1.35 ⭐ 1.34 ⭐ -0.01 👍
Method Length 82.82 🙂 81.18 🙂 -1.64 👍
Working memory 5.64 ⭐ 5.63 ⭐ -0.01 👍
Quality 78.03% 78.17% 0.14% 👍
Other metrics Before After Change
Lines 13196 13468 272
Changed files Quality Before Quality After Quality Change
src/ramstk/configuration.py 62.55% 🙂 62.34% 🙂 -0.21% 👎
src/ramstk/models/db/basedatabase.py 71.30% 🙂 70.68% 🙂 -0.62% 👎
src/ramstk/models/db/program_database.py 88.43% ⭐ 87.45% ⭐ -0.98% 👎
src/ramstk/models/dbtables/basetable.py 77.29% ⭐ 77.50% ⭐ 0.21% 👍
src/ramstk/views/gtk3/fmea/panel.py 78.44% ⭐ 78.73% ⭐ 0.29% 👍
src/ramstk/views/gtk3/fmea/view.py 81.00% ⭐ 83.26% ⭐ 2.26% 👍
src/ramstk/views/gtk3/hardware/panel.py 68.46% 🙂 68.35% 🙂 -0.11% 👎
src/ramstk/views/gtk3/hardware/view.py 80.78% ⭐ 80.77% ⭐ -0.01% 👎
src/ramstk/views/gtk3/stakeholder/panel.py 79.25% ⭐ 79.25% ⭐ 0.00%
src/ramstk/views/gtk3/widgets/baseview.py 83.62% ⭐ 83.62% ⭐ 0.00%
src/ramstk/views/gtk3/widgets/panel.py 79.77% ⭐ 79.82% ⭐ 0.05% 👍
src/ramstk/views/gtk3/widgets/treeview.py 74.98% 🙂 74.91% 🙂 -0.07% 👎
tests/conftest.py 79.43% ⭐ 79.57% ⭐ 0.14% 👍
tests/test_configuration.py 75.23% ⭐ 75.12% ⭐ -0.11% 👎
tests/db/test_base.py 83.82% ⭐ 84.13% ⭐ 0.31% 👍
tests/models/programdb/conftest.py 84.47% ⭐ 84.47% ⭐ 0.00%
tests/models/programdb/test_program_manager.py 85.86% ⭐ 85.34% ⭐ -0.52% 👎
tests/models/programdb/environment/conftest.py 79.44% ⭐ 79.44% ⭐ 0.00%
tests/models/programdb/mission/conftest.py 90.57% ⭐ 90.57% ⭐ 0.00%
tests/models/programdb/mission_phase/conftest.py 85.92% ⭐ 85.92% ⭐ 0.00%
tests/models/programdb/stakeholder/conftest.py 82.00% ⭐ 82.00% ⭐ 0.00%

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/hardware/panel.py HardwareGeneralDataPanel.__init__ 0 ⭐ 441 ⛔ 18 ⛔ 39.76% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_configuration.py TestCreateConfiguration.test_initialize_user_configuration 6 ⭐ 403 ⛔ 11 😞 43.19% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/configuration.py RAMSTKUserConfiguration.__init__ 2 ⭐ 429 ⛔ 13 😞 43.53% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/widgets/treeview.py CellRendererML.do_start_editing 4 ⭐ 292 ⛔ 13 😞 44.30% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/models/db/basedatabase.py BaseDatabase.do_connect 5 ⭐ 215 ⛔ 14 😞 45.76% 😞 Try splitting into smaller methods. Extract out complex expressions

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!

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@weibullguy weibullguy merged commit 16a3fbd into master May 13, 2022
@trafico-bot trafico-bot bot added the endgame: merged Pull Request has been merged successfully label May 13, 2022
@weibullguy weibullguy deleted the feat/issue-32 branch May 13, 2022 21:10
@github-actions github-actions bot 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 May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump: patch Issue or PR documents a bug fix or enhancement requiring a patch version bump. endgame: merged Pull Request has been merged successfully 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.

Existing Failure Modes Not Automatically Removed
1 participant