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

fix: properly handle CellRenderCombo returning integers #940

Merged
merged 4 commits into from
Feb 3, 2022

Conversation

weibullguy
Copy link
Collaborator

@weibullguy weibullguy commented Feb 3, 2022

Does this PR introduce a breaking change?

  • Yes
  • No

Describe the purpose of this pull request.

To properly handle the integer data type returned from CellRendererCombo's when they display string type information.

Describe how this was implemented.

Created lists containing the pick list strings for the CellRendererCombo. The returned integer value then represents the index in the list which can be used to select the proper text to display.

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

None

Provide any other pertinent information.

Closes #820

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.

@github-actions github-actions bot added bump: patch Issue or PR documents a bug fix or enhancement requiring a patch version bump. type: fix Issue or PR affects existing functionality. labels Feb 3, 2022
@weibullguy weibullguy self-assigned this Feb 3, 2022
@weibullguy weibullguy added priority: normal Issue or PR is normal priority. status: inprogress Issue or PR is open, milestoned, and assigned. labels Feb 3, 2022
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 3, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.41 ⭐ 1.36 ⭐ -0.05 👍
Method Length 110.13 🙂 108.95 🙂 -1.18 👍
Working memory 6.44 🙂 6.42 🙂 -0.02 👍
Quality 75.33% 75.41% 0.08% 👍
Other metrics Before After Change
Lines 7768 7926 158
Changed files Quality Before Quality After Quality Change
src/ramstk/views/gtk3/hardware/panel.py 68.36% 🙂 69.53% 🙂 1.17% 👍
src/ramstk/views/gtk3/hardware/view.py 82.79% ⭐ 82.98% ⭐ 0.19% 👍
src/ramstk/views/gtk3/requirement/panel.py 64.10% 🙂 63.30% 🙂 -0.80% 👎
src/ramstk/views/gtk3/requirement/view.py 84.08% ⭐ 84.20% ⭐ 0.12% 👍
src/ramstk/views/gtk3/similar_item/panel.py 81.69% ⭐ 81.83% ⭐ 0.14% 👍
src/ramstk/views/gtk3/similar_item/view.py 83.23% ⭐ 83.23% ⭐ 0.00%
src/ramstk/views/gtk3/validation/panel.py 71.05% 🙂 71.41% 🙂 0.36% 👍
src/ramstk/views/gtk3/widgets/treeview.py 74.86% 🙂 74.86% 🙂 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 HardwareTreePanel._on_module_switch.HardwareGeneralDataPanel.__init__ 0 ⭐ 441 ⛔ 18 ⛔ 39.76% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/validation/panel.py ValidationTreePanel._on_module_switch.ValidationTaskDescriptionPanel.__init__ 0 ⭐ 438 ⛔ 16 ⛔ 41.65% 😞 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/validation/panel.py ValidationTreePanel._on_module_switch.ValidationTaskDescriptionPanel._do_make_task_code.ValidationTaskEffortPanel.__init__ 0 ⭐ 339 ⛔ 15 😞 44.25% 😞 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/views/gtk3/requirement/panel.py RequirementTreePanel._on_module_switch.RequirementGeneralDataPanel.__init__ 0 ⭐ 361 ⛔ 13 😞 46.47% 😞 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!

@sonarcloud
Copy link

sonarcloud bot commented Feb 3, 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 merged commit c05ff87 into master Feb 3, 2022
@trafico-bot trafico-bot bot added the endgame: merged Pull Request has been merged successfully label Feb 3, 2022
@weibullguy weibullguy deleted the fix/issue-820 branch February 3, 2022 00:27
@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 Feb 3, 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 priority: normal Issue or PR is normal priority. status: closed Pull Request is complete and integrated or closed for anther reason. type: fix Issue or PR affects existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gtk.CellRendererCombo() Changes Return Integer, Not String
1 participant