Skip to content

Conversation

@anatol-sialitski
Copy link
Contributor

No description provided.

anatol-sialitski and others added 30 commits October 17, 2025 09:26
anatol-sialitski and others added 14 commits October 17, 2025 09:26
# Conflicts:
#	modules/core/core-content/src/main/java/com/enonic/xp/core/impl/content/ContentServiceImpl.java
#	modules/itest/itest-core/src/test/java/com/enonic/xp/core/content/AbstractContentServiceTest.java
#	modules/itest/itest-core/src/test/java/com/enonic/xp/core/content/AbstractContentSynchronizerTest.java
# Conflicts:
#	modules/admin/admin-impl/src/test/java/com/enonic/xp/admin/impl/tool/XmlAdminToolDescriptorParserTest.java
#	modules/admin/admin-impl/src/test/java/com/enonic/xp/admin/impl/widget/XmlWidgetDescriptorParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/app/ApplicationRelativeResolverTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/form/FormItemSetTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/CheckBoxTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/ComboBoxTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/CustomSelectorTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/DateTimeTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/DateTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/DoubleTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/GeoPointTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/HtmlAreaTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/LongTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/RadioButtonTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/RelativeTimeParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/TextAreaTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/TextLineTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/inputtype/TimeTypeTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/schema/mixin/MixinNameTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/schema/mixin/MixinNamesTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/schema/mixin/MixinTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/schema/mixin/MixinsTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/site/SiteDescriptorTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/InputTypeAliasConvertersTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlApplicationParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlContentTypeParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlInputTypeConfigMapperTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlLayoutDescriptorParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlMacroDescriptorParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlMixinParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlPageDescriptorParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlPartDescriptorParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlServiceDescriptorParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlSiteParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlStyleDescriptorParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlWebappDescriptorParserTest.java
#	modules/core/core-api/src/test/java/com/enonic/xp/xml/parser/XmlXDataParserTest.java
#	modules/core/core-api/src/testFixtures/java/com/enonic/xp/xml/parser/XmlModelParserTest.java
#	modules/core/core-content/src/test/java/com/enonic/xp/core/impl/content/schema/CmsFormFragmentServiceImplTest.java
#	modules/core/core-content/src/test/java/com/enonic/xp/core/impl/content/schema/ContentTypeServiceTest.java
#	modules/core/core-content/src/test/java/com/enonic/xp/core/impl/content/schema/XDataServiceImplTest.java
#	modules/core/core-content/src/test/java/com/enonic/xp/core/impl/site/CmsServiceImplTest.java
#	modules/core/core-repo/src/test/java/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/QueryBuilderTest.java
#	modules/core/core-schema/src/test/java/com/enonic/xp/core/impl/form/FormDefaultValuesProcessorImplTest.java
#	modules/core/core-task/src/test/java/com/enonic/xp/impl/task/XmlTaskDescriptorParserTest.java
#	modules/itest/itest-core/src/test/java/com/enonic/xp/core/dynamic/DynamicSchemaServiceImplTest.java
#	modules/lib/lib-schema/src/test/java/com/enonic/xp/lib/schema/CreateDynamicContentSchemaHandlerTest.java
#	modules/lib/lib-schema/src/test/java/com/enonic/xp/lib/schema/DeleteDynamicContentSchemaHandlerTest.java
#	modules/lib/lib-schema/src/test/java/com/enonic/xp/lib/schema/GetDynamicContentSchemaHandlerTest.java
#	modules/lib/lib-schema/src/test/java/com/enonic/xp/lib/schema/UpdateDynamicContentSchemaHandlerTest.java
#	modules/portal/portal-impl/src/test/java/com/enonic/xp/portal/impl/api/XmlApiDescriptorParserTest.java
@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 81.99673% with 110 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.47%. Comparing base (ba24979) to head (4886683).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...src/main/java/com/enonic/xp/util/GenericValue.java 54.66% 25 Missing and 9 partials ⚠️
...src/main/java/com/enonic/xp/form/FormFragment.java 61.29% 12 Missing ⚠️
.../src/main/java/com/enonic/xp/form/FormItemSet.java 40.00% 3 Missing and 3 partials ⚠️
.../com/enonic/xp/schema/content/ContentTypeName.java 33.33% 0 Missing and 4 partials ⚠️
...xtension/GetListAllowedAdminExtensionsHandler.java 86.36% 0 Missing and 3 partials ⚠️
...api/src/main/java/com/enonic/xp/form/FormItem.java 0.00% 3 Missing ⚠️
...n/java/com/enonic/xp/form/FormOptionSetOption.java 50.00% 3 Missing ⚠️
...ava/com/enonic/xp/inputtype/TextInputTypeBase.java 40.00% 0 Missing and 3 partials ⚠️
...a/com/enonic/xp/schema/mixin/MixinDescriptors.java 82.35% 3 Missing ⚠️
...src/main/java/com/enonic/xp/site/MixinOptions.java 50.00% 3 Missing ⚠️
... and 26 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #11504      +/-   ##
============================================
- Coverage     86.60%   86.47%   -0.14%     
+ Complexity    19607    19442     -165     
============================================
  Files          2528     2562      +34     
  Lines         66628    65907     -721     
  Branches       5367     5205     -162     
============================================
- Hits          57702    56991     -711     
- Misses         6313     6345      +32     
+ Partials       2613     2571      -42     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

public abstract class OccurrencesMapper
{
@JsonCreator
public OccurrencesMapper( @JsonProperty("min") int minimum, @JsonProperty("max") int maximum )

Choose a reason for hiding this comment

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

⚠️ Codacy found a medium BestPractice issue: Avoid unused constructor parameters such as 'maximum'.

The issue reported by the PMD linter indicates that the constructor parameter maximum is not being used within the constructor body. This is considered a best practice violation because it can lead to confusion about the purpose of the parameter if it is not utilized.

To resolve this issue, we can remove the unused parameter from the constructor. Here’s the suggested change:

Suggested change
public OccurrencesMapper( @JsonProperty("min") int minimum, @JsonProperty("max") int maximum )
public OccurrencesMapper( @JsonProperty("min") int minimum )

This comment was generated by an experimental AI tool.

@@ -325,9 +324,9 @@ private BufferedImage cropImage( final BufferedImage image, final Cropping cropp
(int) ( height * cropping.height() ) );
}

private ExtraDatas extractMetadata( final MediaInfo mediaInfo )
private Mixins extractMetadata( final MediaInfo mediaInfo )

Choose a reason for hiding this comment

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

⚠️ Codacy found a medium Complexity issue: The method 'extractMetadata(MediaInfo)' has an NPath complexity of 288, current threshold is 200

The issue identified by the PMD linter relates to the NPath complexity of the extractMetadata method. NPath complexity measures the number of unique execution paths through a method, which can increase significantly with nested loops and conditionals. A high NPath complexity (like 288 in this case) indicates that the method is likely too complex, making it harder to understand, maintain, and test.

To address this complexity issue, one effective approach is to break the method into smaller, more manageable pieces. However, since you requested a single line change, we can focus on simplifying or refactoring a specific part of the method.

Given that the provided code fragment does not include the full implementation of the extractMetadata method, a common approach to reduce complexity is to extract the metadata processing logic into a separate method. However, since we are limited to a single line change, we can make a small adjustment to the existing code that might help reduce complexity slightly.

Here's a suggestion to encapsulate the metadata extraction logic within a helper method, which reduces the complexity by offloading some of the logic:

Suggested change
private Mixins extractMetadata( final MediaInfo mediaInfo )
private Mixins extractMetadata( final MediaInfo mediaInfo ) { return processMetadata(mediaInfo.getMetadata().asMap()); }

In this suggestion, processMetadata would be a new method that you would need to implement to handle the processing of the metadata. This change reduces the complexity of extractMetadata by delegating part of its logic to another method, making it easier to maintain and understand.


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