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 DragResizerUtil for south #606

Merged
merged 1 commit into from
Aug 24, 2023
Merged

Conversation

rsuna
Copy link
Contributor

@rsuna rsuna commented Aug 24, 2023

Make south resize working. See issue #605.

@pr-explainer-bot
Copy link

Pull Request Report

Hey there! I've prepared a report for the pull request. Let's dive in!

Changes

  1. Fixed the isSouth() method in DragResizerUtil.java to include the cases SW_RESIZE, S_RESIZE, and SE_RESIZE.

Suggestions

I have a couple of suggestions to improve the code:

  1. In the isSouth() method, it might be helpful to add comments explaining the purpose of each case. This would make the code more readable and easier to understand.

Bugs

I couldn't find any potential bugs in the code. Great job!

Improvements

I found a place in the code that could be refactored for better readability. Here's the snippet from DragResizerUtil.java:

public boolean isSouth() {
    switch (this) {
        case SW_RESIZE:
        case S_RESIZE:
        case SE_RESIZE:
            return true;
        default:
            return false;
    }
}

To improve readability, we can simplify the switch statement by using a Set to store the cases that return true. Here's the refactored code:

public boolean isSouth() {
    Set<DragResizer> southCases = new HashSet<>(Arrays.asList(SW_RESIZE, S_RESIZE, SE_RESIZE));
    return southCases.contains(this);
}

This way, it's easier to see which cases return true without having to read through the entire switch statement.

Rating

I would rate the code as follows:

  • Readability: 8/10
  • Performance: 9/10
  • Security: 10/10

Overall, the code is quite readable and performs well. It also seems to be secure. Great job!

That's all for the pull request report. Let me know if you need any further assistance. Cheers!

@rsuna rsuna temporarily deployed to coverage August 24, 2023 07:59 — with GitHub Actions Inactive
@rsuna rsuna temporarily deployed to coverage August 24, 2023 07:59 — with GitHub Actions Inactive
@rsuna rsuna temporarily deployed to coverage August 24, 2023 07:59 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02% 🎉

Comparison is base (ca15519) 49.62% compared to head (b028798) 49.65%.
Report is 5 commits behind head on main.

❗ Current head b028798 differs from pull request most recent head dcf893f. Consider uploading reports for the commit dcf893f to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #606      +/-   ##
============================================
+ Coverage     49.62%   49.65%   +0.02%     
- Complexity     6236     6238       +2     
============================================
  Files           379      379              
  Lines         37593    37579      -14     
  Branches       6159     6157       -2     
============================================
+ Hits          18654    18658       +4     
+ Misses        17710    17693      -17     
+ Partials       1229     1228       -1     
Files Changed Coverage Δ
...ava/io/fair_acc/chartfx/utils/DragResizerUtil.java 87.71% <ø> (-0.59%) ⬇️
...n/java/io/fair_acc/chartfx/ui/ProfilerInfoBox.java 98.78% <100.00%> (+18.57%) ⬆️
...fair_acc/chartfx/utils/SimplePerformanceMeter.java 89.06% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

wirew0rm
wirew0rm previously approved these changes Aug 24, 2023
Copy link
Member

@wirew0rm wirew0rm left a comment

Choose a reason for hiding this comment

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

Looks good, Thanks for catching this and directly providing the fix!

I'll apply the formatting patches and merge.

make south resize working
@wirew0rm wirew0rm temporarily deployed to coverage August 24, 2023 11:13 — with GitHub Actions Inactive
@wirew0rm wirew0rm temporarily deployed to coverage August 24, 2023 11:13 — with GitHub Actions Inactive
@wirew0rm wirew0rm temporarily deployed to coverage August 24, 2023 11:13 — with GitHub Actions Inactive
@sonarcloud
Copy link

sonarcloud bot commented Aug 24, 2023

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

@wirew0rm wirew0rm merged commit 5d5f936 into fair-acc:main Aug 24, 2023
4 checks passed
@RalphSteinhagen RalphSteinhagen linked an issue Aug 29, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DragResizerUtil dont resize on south
2 participants