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_measurement to sub-package (Sourcery refactored) #998

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Feb 22, 2022

Pull Request #997 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the refactor/move_ramstkmeasurement_subpackage branch, then run:

git fetch origin sourcery/refactor/move_ramstkmeasurement_subpackage
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

Comment on lines 376 to -378
_entities.append(_entity)
elif module == "Requirement":
_entity = self._do_insert_requirement(_row)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function Import._do_import refactored with the following changes:

  • Simplify conditional into switch-like form (switch)

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Feb 22, 2022

Sourcery Code Quality Report

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 1.31 ⭐ 1.31 ⭐ 0.00
Method Length 117.05 🙂 117.05 🙂 0.00
Working memory 4.66 ⭐ 4.66 ⭐ 0.00
Quality 75.49% 75.49% 0.00%
Other metrics Before After Change
Lines 694 694 0
Changed files Quality Before Quality After Quality Change
src/ramstk/exim/imports.py 75.49% ⭐ 75.49% ⭐ 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/exim/imports.py Import._do_import 7 ⭐ 195 😞 7 🙂 58.51% 🙂 Try splitting into smaller methods
src/ramstk/exim/imports.py Import._do_import._do_insert_design_electric 0 ⭐ 416 ⛔ 4 ⭐ 65.14% 🙂 Try splitting into smaller methods
src/ramstk/exim/imports.py Import._do_import._do_insert_design_mechanic 0 ⭐ 402 ⛔ 4 ⭐ 65.30% 🙂 Try splitting into smaller methods
src/ramstk/exim/imports.py Import._do_import._do_map_to_field._do_read_db_fields._do_read_file 3 ⭐ 72 🙂 11 😞 68.16% 🙂 Extract out complex expressions
src/ramstk/exim/imports.py Import._do_import._do_insert_hardware 0 ⭐ 279 ⛔ 4 ⭐ 68.24% 🙂 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 22, 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 closed this Feb 22, 2022
@weibullguy weibullguy deleted the sourcery/refactor/move_ramstkmeasurement_subpackage branch February 22, 2022 20:45
@weibullguy weibullguy added endgame: invalid Issue or PR is closed as not valid. status: closed Pull Request is complete and integrated or closed for anther reason. labels Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
endgame: invalid Issue or PR is closed as not valid. status: closed Pull Request is complete and integrated or closed for anther reason.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant