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

Content update should use modify method #10937 #10938

Open
wants to merge 4 commits into
base: epic-node-upgrading
Choose a base branch
from

Conversation

vbradnitski
Copy link
Contributor

No description provided.

@vbradnitski vbradnitski marked this pull request as ready for review February 26, 2025 15:00
@vbradnitski vbradnitski requested a review from rymsha February 26, 2025 15:00
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 79.31034% with 18 lines in your changes missing coverage. Please review.

Project coverage is 84.69%. Comparing base (d9ef926) to head (37352d8).
Report is 1 commits behind head on epic-node-upgrading.

Files with missing lines Patch % Lines
...nic/xp/core/impl/content/UpdateContentCommand.java 81.13% 4 Missing and 6 partials ⚠️
...re/impl/content/validate/ContentTypeValidator.java 0.00% 6 Missing ⚠️
.../java/com/enonic/xp/content/ModifiableContent.java 96.15% 0 Missing and 1 partial ⚠️
...nonic/xp/core/impl/content/ContentServiceImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             epic-node-upgrading   #10938      +/-   ##
=========================================================
+ Coverage                  84.61%   84.69%   +0.07%     
- Complexity                 20054    20066      +12     
=========================================================
  Files                       2641     2641              
  Lines                      69707    69676      -31     
  Branches                    5617     5610       -7     
=========================================================
+ Hits                       58984    59010      +26     
+ Misses                      8007     7952      -55     
+ Partials                    2716     2714       -2     

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

{
return contentBeforeChange;
}
if ( currentInherit.contains( ContentInheritType.CONTENT ) || currentInherit.contains( ContentInheritType.NAME ) )

Choose a reason for hiding this comment

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

⚠️ Codacy found a medium ErrorProne issue: These nested if statements could be combined

The issue identified by the PMD linter is that the nested if statements could be combined into a single conditional statement to improve code clarity and reduce redundancy. In this case, since the outer if already checks params.stopInherit(), we can combine the two conditions into one.

Here’s the suggested single line change to combine the conditions:

Suggested change
if ( currentInherit.contains( ContentInheritType.CONTENT ) || currentInherit.contains( ContentInheritType.NAME ) )
if (params.stopInherit() && (currentInherit.contains(ContentInheritType.CONTENT) || currentInherit.contains(ContentInheritType.NAME))) {

This change ensures that both conditions are checked in one statement, making the code cleaner and easier to read.


This comment was generated by an experimental AI tool.

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.

2 participants