-
Notifications
You must be signed in to change notification settings - Fork 4
Add DataDetailsQuery class for GraphQL queries #38
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,92 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| package com.flecso.employer.graphql.query; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.coxautodev.graphql.tools.GraphQLQueryResolver; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.central.entity.AccountStateType; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.dto.DependencyVulDetails; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.dto.InProgressWorkItems; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.dto.analytics.*; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.dto.analytics.build.BuildDetails; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.dto.analytics.build.BuildStageDetails; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.dto.analytics.prmetricdetail.PRMetricDetails; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.dto.filters.IssueFilterConditions; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.entity.*; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.central.entity.MetricConfig; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.exception.ConfigurationException; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.exception.ErrorCode; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.exception.GlobalExceptionHandler; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.repository.*; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.service.ContributorService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.service.CustomMetricService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.service.DateUtil; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.service.MetricsMetadataService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.service.TeamService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.service.deliverable.DeliverableService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.strategy.GitMetricCalculationStrategy; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.flecso.employer.util.Constants; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.commons.collections4.CollectionUtils; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.commons.lang3.ObjectUtils; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.commons.lang3.StringUtils; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.commons.lang3.tuple.Pair; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import org.springframework.stereotype.Component; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.time.LocalDate; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.*; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.stream.Collectors; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Component | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public class DataDetailsQuery extends BaseQuery implements GraphQLQueryResolver { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IssueUnitCustomRepoImpl issueUnitCustomRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+40
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent Field VisibilityInconsistent field visibility mixing package-private and private access modifiers for dependency injection. Some fields lack private modifier while others include it, creating unclear encapsulation boundaries. Standards
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BuildDeploymentUnitCustomRepo buildDeploymentUnitCustomRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GitUnitPrCustomRepoImpl gitUnitPrCustomRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+40
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Field Injection PatternField injection creates dependencies that are difficult to test and may cause initialization order issues. Constructor injection provides better testability, immutability, and fail-fast behavior during application startup. Standards
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VulnerabilityUnitsCustomRepo vulnerabilityUnitsCustomRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EventLogGitCustomRepoImpl eventLogGitCustomRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ContributorService contributorService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Games24X7CustomRepoImpl games24X7CustomRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TeamService teamService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private CustomMetricService customMetricService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private GlobalExceptionHandler globalExceptionHandler; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private WorkBreakdownCustomRepo workBreakdownCustomRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private MetricsMetadataService metricsMetadataService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private RecruitCRMCustomQueryRepoImpl recruitCRMCustomQueryRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private DeliverableService deliverableService; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private GitMetricCalculationStrategy gitMetricCalculationStrategy; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Autowired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private SprintCustomRepoImpl sprintCustomRepo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+40
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class injects a large number of dependencies, but only
Suggested change
Comment on lines
+40
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainRemove unused autowired dependencies. Most of the 16 autowired dependencies appear unused in this class. Only Run the following script to verify which dependencies are actually used: 🏁 Script executed: #!/bin/bash
# Description: Check if each autowired dependency is referenced in DataDetailsQuery.java
echo "Checking dependency usage in DataDetailsQuery.java..."
for dep in "issueUnitCustomRepo" "buildDeploymentUnitCustomRepo" "vulnerabilityUnitsCustomRepo" \
"eventLogGitCustomRepo" "contributorService" "games24X7CustomRepo" \
"teamService" "customMetricService" "globalExceptionHandler" \
"workBreakdownCustomRepo" "metricsMetadataService" "recruitCRMCustomQueryRepo" \
"deliverableService" "gitMetricCalculationStrategy" "sprintCustomRepo"; do
echo "---"
echo "Dependency: $dep"
rg -n "\b$dep\b" --type java DataDetailsQuery.java | grep -v "@Autowired" || echo " NOT USED in DataDetailsQuery.java"
doneLength of output: 1496 The web search provides context about Spring GraphQL architecture but not specifics about this codebase. Let me generate shell scripts to verify the actual usage of these dependencies in the repository. 🏁 Script executed: #!/bin/bash
# Find DataDetailsQuery.java and display full content
echo "=== Finding DataDetailsQuery.java ==="
fd -e java -i "datadetailsquery" --exec cat {} \;Length of output: 4016 🏁 Script executed: #!/bin/bash
# Find BaseQuery.java
echo "=== Finding BaseQuery.java ==="
fd -e java -i "basequery" --exec cat {} \;Length of output: 30 🏁 Script executed: #!/bin/bash
# Search for usages of gitUnitPrCustomRepo across the codebase
echo "=== Checking gitUnitPrCustomRepo usage in full repository ==="
rg -n "gitUnitPrCustomRepo" --type java -C2 | head -50Length of output: 888 🏁 Script executed: #!/bin/bash
# Check if any other dependencies are used in the entire codebase
echo "=== Checking if unused dependencies are referenced elsewhere in codebase ==="
for dep in "issueUnitCustomRepo" "buildDeploymentUnitCustomRepo" "vulnerabilityUnitsCustomRepo" \
"eventLogGitCustomRepo" "contributorService" "games24X7CustomRepo" \
"teamService" "customMetricService" "globalExceptionHandler" \
"workBreakdownCustomRepo" "metricsMetadataService" "recruitCRMCustomQueryRepo" \
"deliverableService" "gitMetricCalculationStrategy" "sprintCustomRepo"; do
count=$(rg -c "\b$dep\b" --type java 2>/dev/null | awk -F: '{sum+=$2} END {print sum}')
if [ "$count" -gt 1 ]; then
echo "$dep: used $count times (likely in multiple files)"
fi
doneLength of output: 76 Remove unused autowired dependencies from DataDetailsQuery.java (lines 40-78). Verification confirms 14 of the 15 autowired dependencies are completely unused in this class. The
Retain only |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public CommitMetricDetails getCommitReportDetail(String metric, String granularity, Filter filter, Integer pageNumber, Integer pageSize) throws Exception { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Input ValidationGraphQL query method accepts user input parameters without validation checks. Missing validation on metric name, pagination parameters, and filter objects could lead to injection attacks or application errors. Standards
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix unused parameter and overly broad exception declaration. Two critical issues with the method signature:
Apply this diff to remove the unused parameter and narrow the exception type: -public CommitMetricDetails getCommitReportDetail(String metric, String granularity, Filter filter, Integer pageNumber, Integer pageSize) throws Exception {
+public CommitMetricDetails getCommitReportDetail(String metric, Filter filter, Integer pageNumber, Integer pageSize) throws ConfigurationException {If
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setDateRangeFromSprintId(filter); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MetricConfig metricConfig = getMetricConfig(metric); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Metric metricType = Metric.valueOf(metric); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Example: try {
Metric metricType = Metric.valueOf(metric);
} catch (IllegalArgumentException e) {
// It's good practice to throw a specific GraphQL exception
// that will be translated into a proper error response.
throw new GraphQLException("Invalid 'metric' parameter provided.");
}
Comment on lines
+80
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Null Parameter RiskMethod parameters used without null validation before processing operations. Null filter parameter passed to setDateRangeFromSprintId() or null metric parameter to Metric.valueOf() causes NullPointerException. Standards
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enum Conversion FailureMetric.valueOf() throws IllegalArgumentException for invalid metric string values without exception handling. Invalid metric parameter causes uncaught runtime exception terminating GraphQL query processing. Standards
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add error handling for enum conversion. The Wrap the conversion with proper error handling: - Metric metricType = Metric.valueOf(metric);
+ Metric metricType;
+ try {
+ metricType = Metric.valueOf(metric);
+ } catch (IllegalArgumentException e) {
+ throw new ConfigurationException(ErrorCode.INVALID_METRIC, "Invalid metric: " + metric);
+ }
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pair<List<String>, List<String>> assigneeAndProjectList = getAssigneeAndProjectList(filter, metricConfig); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| List<String> repoList = assigneeAndProjectList.getRight(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| List<String> assignees = assigneeAndProjectList.getLeft(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| List<String> prIds = filter.getPrViewFilters() != null && CollectionUtils.isNotEmpty(filter.getPrViewFilters().getPrIds()) ? filter.getPrViewFilters().getPrIds() : new ArrayList<>(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line can be slightly improved. Using
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CommitMetricDetails commitMetricDetails = gitUnitPrCustomRepo.getCommitReportDetailList(filter.getOrgId(), metricType, filter.getLocalStartDateFromEndDate(), filter.getEndDate(),assignees, repoList, prIds, filter.getTimeZone(), pageNumber, pageSize); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SQL Injection RiskMultiple user-controlled parameters passed to database query method without visible input validation. Filter parameters like orgId, date ranges, assignees, and prIds could contain malicious payloads leading to SQL injection if not properly sanitized in the repository layer. Standards
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return commitMetricDetails; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+80
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add input validation for method parameters. The method lacks validation for its parameters, which can lead to runtime exceptions and security issues:
Add validation at the beginning of the method: public CommitMetricDetails getCommitReportDetail(String metric, String granularity, Filter filter, Integer pageNumber, Integer pageSize) throws Exception {
+ if (filter == null) {
+ throw new IllegalArgumentException("Filter cannot be null");
+ }
+ if (StringUtils.isBlank(metric)) {
+ throw new IllegalArgumentException("Metric cannot be null or empty");
+ }
+ if (pageNumber == null || pageNumber < 1) {
+ throw new IllegalArgumentException("Page number must be greater than 0");
+ }
+ if (pageSize == null || pageSize < 1 || pageSize > 1000) {
+ throw new IllegalArgumentException("Page size must be between 1 and 1000");
+ }
+
setDateRangeFromSprintId(filter);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
God Object Pattern
Class violates Single Responsibility Principle with 14 injected dependencies handling diverse concerns (issues, builds, vulnerabilities, git, contributors, games, teams, metrics, exceptions, work breakdown, recruitment, deliverables, sprints). This creates excessive coupling and makes the class fragile to changes across multiple domains.
Commitable Suggestion
Standards