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_status to sub-package #1004

Merged
merged 5 commits into from
Feb 23, 2022

Conversation

weibullguy
Copy link
Collaborator

@weibullguy weibullguy commented Feb 23, 2022

Does this PR introduce a breaking change?

  • Yes
  • No

Describe the purpose of this pull request.

To move the common database tables to sub-packages under commondb.

Describe how this was implemented.

Created status sub-package. Moved ramstk_status.py to sub-package as record.py. Created table.py. Updated ramstk_status test suite and documentation.

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

    • 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 the type: refactor Issue or PR dealing with refactoring of RAMSTK code. label Feb 23, 2022
@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #1004 (ffaf750) into master (7d3a9db) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1004      +/-   ##
==========================================
+ Coverage   94.91%   94.92%   +0.01%     
==========================================
  Files         180      182       +2     
  Lines        5312     5325      +13     
  Branches      506      507       +1     
==========================================
+ Hits         5042     5055      +13     
  Misses        235      235              
  Partials       35       35              
Flag Coverage Δ
3.6 94.92% <100.00%> (+0.01%) ⬆️
3.7 94.92% <100.00%> (+0.01%) ⬆️
3.8 94.92% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
src/ramstk/__main__.py 0.00% <ø> (ø)
src/ramstk/models/__init__.py 100.00% <ø> (ø)
src/ramstk/models/basemodel.py 100.00% <ø> (ø)
src/ramstk/models/commondb/__init__.py 100.00% <ø> (ø)
src/ramstk/models/commondb/database.py 100.00% <ø> (ø)
src/ramstk/models/commondb/status/__init__.py 100.00% <100.00%> (ø)
src/ramstk/models/commondb/status/record.py 100.00% <100.00%> (ø)
src/ramstk/models/commondb/status/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 7d3a9db...ffaf750. Read the comment docs.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 23, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.50 ⭐ 1.55 ⭐ 0.05 👎
Method Length 68.05 🙂 71.19 🙂 3.14 👎
Working memory 5.00 ⭐ 5.04 ⭐ 0.04 👎
Quality 79.72% 79.22% -0.50% 👎
Other metrics Before After Change
Lines 3343 3242 -101
Changed files Quality Before Quality After Quality Change
src/ramstk/main.py 74.48% 🙂 74.48% 🙂 0.00%
src/ramstk/models/init.py % % %
src/ramstk/models/basemodel.py 75.20% ⭐ 75.20% ⭐ 0.00%
src/ramstk/models/commondb/init.py % % %
src/ramstk/models/commondb/database.py 80.29% ⭐ 80.29% ⭐ 0.00%
src/ramstk/views/gtk3/desktop.py 82.27% ⭐ 82.27% ⭐ 0.00%
src/ramstk/views/gtk3/books/modulebook.py 89.74% ⭐ 89.74% ⭐ 0.00%
src/ramstk/views/gtk3/hazard_analysis/panel.py 81.44% ⭐ 81.44% ⭐ 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/models/commondb/database.py RAMSTKCommonDB.do_load_site_info 1 ⭐ 360 ⛔ 7 🙂 57.30% 🙂 Try splitting into smaller methods
src/ramstk/models/basemodel.py RAMSTKBaseTable.do_select_all 10 🙂 163 😞 7 🙂 58.51% 🙂 Try splitting into smaller methods
src/ramstk/views/gtk3/hazard_analysis/panel.py HazardsTreePanel.__init__ 0 ⭐ 1119 ⛔ 6 ⭐ 58.82% 🙂 Try splitting into smaller methods
src/ramstk/models/basemodel.py RAMSTKBaseTable.do_set_attributes.do_set_attributes_all.do_update 6 ⭐ 180 😞 7 🙂 60.71% 🙂 Try splitting into smaller methods
src/ramstk/views/gtk3/desktop.py RAMSTKDesktop.__init__ 2 ⭐ 187 😞 8 🙂 61.71% 🙂 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!

@sonarcloud
Copy link

sonarcloud bot commented Feb 23, 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 self-assigned this Feb 23, 2022
@github-actions github-actions bot added the status: inprogress Issue or PR is open, milestoned, and assigned. label Feb 23, 2022
@weibullguy weibullguy added the priority: normal Issue or PR is normal priority. label Feb 23, 2022
@weibullguy weibullguy merged commit 0359625 into master Feb 23, 2022
@trafico-bot trafico-bot bot added the endgame: merged Pull Request has been merged successfully label Feb 23, 2022
@weibullguy weibullguy deleted the refactor/move_ramstkstatus_subpackage branch February 23, 2022 19:38
@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
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: refactor Issue or PR dealing with refactoring of RAMSTK code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant