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: raise dialog to inform user of issues encountered while running application #1023

Merged
merged 6 commits into from
Mar 5, 2022

Conversation

weibullguy
Copy link
Collaborator

@weibullguy weibullguy commented Mar 5, 2022

Does this PR introduce a breaking change?

  • Yes
  • No

Describe the purpose of this pull request.

To raise a dialog whenever a message is sent that corresponds to the user's selected log level. This dialog displays the same message that is being sent to the logger. All messages will be sent to the status bar regardless of the user's selected log level.

Describe how this was implemented.

Add method to RAMSTKDesktop to listen for do_log_XX messages and raise a dialog with the message if the log level is the same as the user's selected log level.

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

None

Provide any other pertinent information.

Closes #1005

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 Mar 5, 2022
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 5, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.42 ⭐ 1.43 ⭐ 0.01 👎
Method Length 62.39 🙂 62.78 🙂 0.39 👎
Working memory 5.47 ⭐ 5.50 ⭐ 0.03 👎
Quality 79.75% 79.59% -0.16% 👎
Other metrics Before After Change
Lines 4330 4396 66
Changed files Quality Before Quality After Quality Change
src/ramstk/models/dbrecords/programdb_design_electric_record.py 74.64% 🙂 74.64% 🙂 0.00%
src/ramstk/models/dbtables/basetable.py 75.65% ⭐ 75.65% ⭐ 0.00%
src/ramstk/models/dbtables/programdb_similar_item_table.py 74.70% 🙂 74.70% 🙂 0.00%
src/ramstk/views/gtk3/desktop.py 82.27% ⭐ 81.56% ⭐ -0.71% 👎
src/ramstk/views/gtk3/assistants/project.py 74.50% 🙂 74.50% 🙂 0.00%
src/ramstk/views/gtk3/books/modulebook.py 89.74% ⭐ 86.89% ⭐ -2.85% 👎
src/ramstk/views/gtk3/hardware/view.py 79.32% ⭐ 79.32% ⭐ 0.00%
src/ramstk/views/gtk3/widgets/dialog.py 79.41% ⭐ 79.38% ⭐ -0.03% 👎
src/ramstk/views/gtk3/widgets/panel.py 79.77% ⭐ 79.77% ⭐ 0.00%
tests/views/gtk3/widgets/test_dialog.py 91.15% ⭐ 91.15% ⭐ 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/assistants/project.py OpenProject._do_request_open_project 11 🙂 109 🙂 12 😞 53.55% 🙂 Extract out complex expressions
src/ramstk/models/dbtables/basetable.py RAMSTKBaseTable.do_update 6 ⭐ 139 😞 10 😞 58.19% 🙂 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/views/gtk3/desktop.py RAMSTKDesktop.__init__ 2 ⭐ 215 ⛔ 8 🙂 59.61% 🙂 Try splitting into smaller methods
src/ramstk/views/gtk3/widgets/dialog.py RAMSTKDatabaseSelect.__init__ 0 ⭐ 159 😞 11 😞 60.10% 🙂 Try splitting into smaller methods. Extract out complex expressions
src/ramstk/models/dbtables/programdb_similar_item_table.py RAMSTKSimilarItemTable._do_calculate_user_defined 0 ⭐ 239 ⛔ 6 ⭐ 64.95% 🙂 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!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 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 1 Code Smell

No Coverage information No Coverage information
1.1% 1.1% Duplication

@weibullguy weibullguy self-assigned this Mar 5, 2022
@github-actions github-actions bot added the status: inprogress Issue or PR is open, milestoned, and assigned. label Mar 5, 2022
@weibullguy weibullguy added bump: patch Issue or PR documents a bug fix or enhancement requiring a patch version bump. priority: normal Issue or PR is normal priority. type: fix Issue or PR affects existing functionality. status: inprogress Issue or PR is open, milestoned, and assigned. and removed status: inprogress Issue or PR is open, milestoned, and assigned. 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 Mar 5, 2022
@codecov
Copy link

codecov bot commented Mar 5, 2022

Codecov Report

Merging #1023 (e09d652) into master (bd380d8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1023   +/-   ##
=======================================
  Coverage   94.80%   94.80%           
=======================================
  Files         144      144           
  Lines        5194     5194           
  Branches      508      508           
=======================================
  Hits         4924     4924           
  Misses        233      233           
  Partials       37       37           
Flag Coverage Δ
3.6 94.80% <ø> (ø)
3.7 94.80% <ø> (ø)
3.8 94.80% <ø> (ø)

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

Impacted Files Coverage Δ
...dels/dbrecords/programdb_design_electric_record.py 100.00% <ø> (ø)
src/ramstk/models/dbtables/basetable.py 100.00% <ø> (ø)
...tk/models/dbtables/programdb_similar_item_table.py 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 bd380d8...e09d652. Read the comment docs.

@weibullguy weibullguy merged commit b0cd45e into master Mar 5, 2022
@trafico-bot trafico-bot bot added the endgame: merged Pull Request has been merged successfully label Mar 5, 2022
@weibullguy weibullguy deleted the feature/issue-1005 branch March 5, 2022 17:02
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: inprogress Issue or PR is open, milestoned, and assigned. type: fix Issue or PR affects existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raise Error Dialog When RAMSTKModuleBook Switches to Page with No Program Open
1 participant