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

Reduced complexity for methods in JavaParserFacade #3204

Merged
merged 16 commits into from
Nov 24, 2021

Conversation

4everTheOne
Copy link
Contributor

@4everTheOne 4everTheOne commented Mar 26, 2021

This PR refactors the JavaParserFacade code to make it easier to read. This also replaces the use of instanceOf with the correspondent "is" method (e.g. isClassOrInterfaceType() ) and the "as" method (eg. asClassOrInterfaceType() ).

This was initially done in PR #3182 and was moved to this one to keep things separated.

@javaparser javaparser deleted a comment from codecov bot Mar 27, 2021
@codecov
Copy link

codecov bot commented Jun 2, 2021

Codecov Report

Merging #3204 (80c1bcb) into master (ec11a2b) will decrease coverage by 0.649%.
The diff coverage is 78.947%.

❗ Current head 80c1bcb differs from pull request most recent head a260a55. Consider uploading reports for the commit a260a55 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##              master     #3204       +/-   ##
===============================================
- Coverage     58.046%   57.397%   -0.650%     
+ Complexity      2621      2573       -48     
===============================================
  Files            628       616       -12     
  Lines          34224     34303       +79     
  Branches        5834      5800       -34     
===============================================
- Hits           19866     19689      -177     
- Misses         12322     12646      +324     
+ Partials        2036      1968       -68     
Flag Coverage Δ
AlsoSlowTests 57.397% <78.947%> (-0.650%) ⬇️
javaparser-core 52.982% <ø> (-0.830%) ⬇️
javaparser-symbol-solver 35.515% <78.947%> (-0.275%) ⬇️
jdk-10 57.390% <78.947%> (-0.650%) ⬇️
jdk-11 57.390% <78.947%> (-0.650%) ⬇️
jdk-12 57.390% <78.947%> (-0.647%) ⬇️
jdk-13 57.384% <78.947%> (-0.656%) ⬇️
jdk-14 57.390% <78.947%> (-0.650%) ⬇️
jdk-15 57.390% <78.947%> (-0.650%) ⬇️
jdk-16 57.390% <78.947%> (-0.650%) ⬇️
jdk-8 57.394% <78.947%> (-0.650%) ⬇️
jdk-9 57.387% <78.947%> (-0.647%) ⬇️
macos-latest 57.388% <78.947%> (-0.650%) ⬇️
ubuntu-latest 57.382% <78.947%> (-0.650%) ⬇️
windows-latest 57.388% <78.947%> (-0.641%) ⬇️

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

Impacted Files Coverage Δ
...symbolsolver/javaparsermodel/JavaParserFacade.java 74.613% <78.947%> (+0.686%) ⬆️
...ava/com/github/javaparser/ast/expr/SimpleName.java 70.370% <0.000%> (-20.106%) ⬇️
...om/github/javaparser/ast/comments/LineComment.java 56.521% <0.000%> (-19.949%) ⬇️
...java/com/github/javaparser/ast/stmt/EmptyStmt.java 47.619% <0.000%> (-19.048%) ⬇️
...m/github/javaparser/ast/comments/BlockComment.java 52.173% <0.000%> (-18.415%) ⬇️
...github/javaparser/ast/comments/JavadocComment.java 54.166% <0.000%> (-18.056%) ⬇️
...om/github/javaparser/ast/expr/NullLiteralExpr.java 42.857% <0.000%> (-17.143%) ⬇️
...com/github/javaparser/ast/stmt/UnparsableStmt.java 45.454% <0.000%> (-17.046%) ⬇️
...thub/javaparser/ast/expr/MarkerAnnotationExpr.java 52.000% <0.000%> (-16.422%) ⬇️
...github/javaparser/ast/expr/BooleanLiteralExpr.java 67.741% <0.000%> (-16.259%) ⬇️
... and 154 more

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 5b8f0c5...a260a55. Read the comment docs.

@MysterAitch MysterAitch added this to the next release milestone Nov 24, 2021
@MysterAitch MysterAitch added the PR: Changed A PR that changes implementation without changing behaviour (e.g. performance) label Nov 24, 2021
@MysterAitch
Copy link
Member

Apologies for the delay, but thank you @4everTheOne -- much appreciated 👍

Breaking it into the separate commits was really helpful 👍

Once the checks are complete it'll be merged in 🎉

@MysterAitch MysterAitch merged commit 0da5a8b into javaparser:master Nov 24, 2021
@MysterAitch MysterAitch changed the title Reduced complexity for methods in JavaParserFacade Reduced complexity for methods in JavaParserFacade Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Changed A PR that changes implementation without changing behaviour (e.g. performance)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants