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

LinkImpl: avoid redundant repository lookups #2453

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

joerghoh
Copy link
Collaborator

@joerghoh joerghoh commented Feb 18, 2023

The LinkBuilderImpl does a few lookups in the repository (mostly path-to-resource lookups), which are redundant and can be avoided.

This is the case if the LinkBuilderImpl is already invoked with a linktarget of an asset or a page; there is no need to retrieve the asset/page again from the path of the provided object).
Also in the creation of the linkUrl there is no need to trying to resolve the path back to a page to determine if the ".html" extension should be added, this information is already available.

@sonarcloud
Copy link

sonarcloud bot commented Feb 18, 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
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Feb 18, 2023

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 87.17%. Comparing base (e333b37) to head (d45bfad).

Files Patch % Lines
...core/components/internal/link/LinkBuilderImpl.java 80.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2453      +/-   ##
============================================
- Coverage     87.21%   87.17%   -0.04%     
- Complexity     2665     2668       +3     
============================================
  Files           233      233              
  Lines          7123     7128       +5     
  Branches       1085     1090       +5     
============================================
+ Hits           6212     6214       +2     
- Misses          362      363       +1     
- Partials        549      551       +2     

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

@joerghoh joerghoh changed the title avoid redundant repository lookups LinkImpl: avoid redundant repository lookups Feb 25, 2023
@Buuhuu Buuhuu added this to the 2.23.0 milestone Apr 21, 2023
@vladbailescu vladbailescu modified the milestones: 2.23.0, 2.24.0 Jun 2, 2023
@LSantha LSantha modified the milestones: 2.24.0, 2.24.1, 2.24.2 Feb 14, 2024
# Conflicts:
#	bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/link/LinkBuilderImpl.java
Copy link

sonarcloud bot commented Feb 29, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@LSantha LSantha merged commit 23504e0 into main Mar 1, 2024
15 checks passed
@LSantha LSantha deleted the improve-LinkImpl-repoaccess branch March 1, 2024 13:55
@vladbailescu vladbailescu modified the milestones: 2.24.4, 2.24.6 Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants