Skip to content

Commit

Permalink
fix: SonarQube code smells (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoriev authored Oct 22, 2024
1 parent f19681d commit fe0fbe3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public byte[] convertToPdf(@NotNull ExportParams exportParams, @Nullable ExportM
return switch (exportParams.getDocumentType()) {
case LIVE_DOC -> documentDataHelper.getLiveDoc(Objects.requireNonNull(project), exportParams);
case LIVE_REPORT -> documentDataHelper.getLiveReport(project, exportParams);
case TEST_RUN -> documentDataHelper.getTestRun(project, exportParams);
case TEST_RUN -> documentDataHelper.getTestRun(Objects.requireNonNull(project), exportParams);
case WIKI_PAGE -> documentDataHelper.getWikiPage(project, exportParams);
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public PdfExporterPolarionService(@NotNull ITrackerService trackerService, @NotN
public @Nullable ITrackerProject getProjectFromScope(@Nullable String scope) {
ITrackerProject project = null;

if (!StringUtils.isEmpty(scope)) {
if (scope != null && !scope.isEmpty()) {
String projectId = ScopeUtils.getProjectFromScope(scope);
if (projectId == null) {
throw new IllegalArgumentException(String.format("Wrong scope format: %s. Should be of form 'project/{projectId}/'", scope));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ public ReadOnlyStrictMap<String, RichPageParameter> getParametersDefinition(@Not
.dependencySource(true)
.build();
parameters.put("dataSet", dataSet);
parameters.put("propertiesSidebarFields", this.createSidebarFieldsParameter(parameterFactory));
parameters.put("propertiesSidebarFields", this.constructSidebarFieldsParameter(parameterFactory));
IntegerParameter top = parameterFactory.integer(localization.getString("richpages.widget.table.top")).value(50).build();
CompositeParameter advanced = parameterFactory.composite(localization.getString("richpages.widget.advanced")).collapsedByDefault(true).add("top", top).build();
parameters.put("advanced", advanced);
return parameters;
}

@NotNull
private FieldsParameter createSidebarFieldsParameter(@NotNull ParameterFactory factory) {
private FieldsParameter constructSidebarFieldsParameter(@NotNull ParameterFactory factory) {
FieldsParameter parameter = factory.fields(factory.context().localization().getString("richpages.widget.table.parameters.propertiesSidebarFields")).disallowedFields(WidgetUtil.getExcludedPropertiesSidebarFields()).dependencyTarget(true).build();
parameter.defaultFields().set(WidgetUtil.getDefaultWidgetPropertiesSidebarFields());
return parameter;
Expand Down

0 comments on commit fe0fbe3

Please sign in to comment.