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

refactor: move ramstk_hazards to subpackage #992

Merged
merged 3 commits into from
Feb 21, 2022

Conversation

weibullguy
Copy link
Collaborator

@weibullguy weibullguy commented Feb 21, 2022

Does this PR introduce a breaking change?

  • Yes
  • No

Describe the purpose of this pull request.

To move common database tables into their own sub-packages under commondb.

Describe how this was implemented.

Created hazards subpackage. Moved rasmtk_hazards.py to record.py in subpackage. Created table.py. Updated test suite.

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

None

Provide any other pertinent information.

Partially implements #846

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

    • Problem areas outside the scope of this PR have an # ISSUE: comment
      decorating the code block. These # ISSUE: comments are automatically
      converted to issues on successful merge. Alternatively, you can manually
      raise an issue for each problem area you identify.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 21, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.83 ⭐ 0.94 ⭐ 0.11 👎
Method Length 52.93 ⭐ 59.00 ⭐ 6.07 👎
Working memory 5.17 ⭐ 5.34 ⭐ 0.17 👎
Quality 81.88% 80.32% -1.56% 👎
Other metrics Before After Change
Lines 979 908 -71
Changed files Quality Before Quality After Quality Change
src/ramstk/models/init.py % % %
src/ramstk/models/commondb/init.py % % %
src/ramstk/models/commondb/database.py 80.31% ⭐ 80.32% ⭐ 0.01% 👍
src/ramstk/models/programdb/action/init.py % % %

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

File Function Complexity Length Working Memory Quality Recommendation
src/ramstk/models/commondb/database.py RAMSTKCommonDB.do_load_site_info 1 ⭐ 360 ⛔ 7 🙂 57.30% 🙂 Try splitting into smaller methods
src/ramstk/models/commondb/database.py RAMSTKCommonDB.do_load_site_variables 0 ⭐ 164 😞 6 ⭐ 70.59% 🙂 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 the type: refactor Issue or PR dealing with refactoring of RAMSTK code. label Feb 21, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 21, 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
2.5% 2.5% Duplication

@codecov
Copy link

codecov bot commented Feb 21, 2022

Codecov Report

Merging #992 (f9e2e1e) into master (0ffdda0) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #992      +/-   ##
==========================================
+ Coverage   94.88%   94.89%   +0.01%     
==========================================
  Files         164      166       +2     
  Lines        5300     5312      +12     
  Branches      517      518       +1     
==========================================
+ Hits         5029     5041      +12     
  Misses        234      234              
  Partials       37       37              
Flag Coverage Δ
3.6 94.89% <100.00%> (+0.01%) ⬆️
3.7 94.89% <100.00%> (+0.01%) ⬆️
3.8 94.89% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
src/ramstk/models/__init__.py 100.00% <ø> (ø)
src/ramstk/models/commondb/__init__.py 100.00% <ø> (ø)
src/ramstk/models/programdb/action/__init__.py 100.00% <ø> (ø)
src/ramstk/models/commondb/database.py 100.00% <100.00%> (ø)
src/ramstk/models/commondb/hazards/__init__.py 100.00% <100.00%> (ø)
src/ramstk/models/commondb/hazards/record.py 100.00% <100.00%> (ø)
src/ramstk/models/commondb/hazards/table.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 0ffdda0...f9e2e1e. Read the comment docs.

@weibullguy weibullguy merged commit 7ea9513 into master Feb 21, 2022
@trafico-bot trafico-bot bot added the endgame: merged Pull Request has been merged successfully label Feb 21, 2022
@github-actions github-actions bot added the status: closed Pull Request is complete and integrated or closed for anther reason. label Feb 21, 2022
@trafico-bot trafico-bot bot removed the status: closed Pull Request is complete and integrated or closed for anther reason. label Feb 21, 2022
@weibullguy weibullguy deleted the refactor/move_ramstkhazards_subpackage branch February 21, 2022 17:19
@weibullguy weibullguy self-assigned this Feb 21, 2022
@weibullguy weibullguy added priority: low Issue or PR is low priority. status: closed Pull Request is complete and integrated or closed for anther reason. labels Feb 21, 2022
@github-actions github-actions bot added the status: inprogress Issue or PR is open, milestoned, and assigned. label Feb 21, 2022
@weibullguy weibullguy removed the status: inprogress Issue or PR is open, milestoned, and assigned. label Feb 21, 2022
weibullguy added a commit that referenced this pull request Feb 21, 2022
* master:
  refactor: move ramstk_hazards to subpackage (#992)
  refactor: move ramstk_group to a package (#991)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
endgame: merged Pull Request has been merged successfully priority: low Issue or PR is low priority. status: closed Pull Request is complete and integrated or closed for anther reason. type: refactor Issue or PR dealing with refactoring of RAMSTK code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant