-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Reduced cognitive complexity of ProcessDefinitionServiceImpl class #15729
base: dev
Are you sure you want to change the base?
Conversation
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.
@akshitk20 please run 'mvn spotless:apply' to fix the code style
...scheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/TaskDependencyUtility.java
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #15729 +/- ##
============================================
- Coverage 39.25% 39.23% -0.02%
- Complexity 4912 4916 +4
============================================
Files 1323 1323
Lines 45191 45210 +19
Branches 4812 4810 -2
============================================
+ Hits 17738 17739 +1
- Misses 25570 25587 +17
- Partials 1883 1884 +1 ☔ View full report in Codecov by Sentry. |
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.
LGTM.
private static final int thresholdSize = 1000000000; // 1 GB | ||
private static final double thresholdRatio = 10; | ||
|
||
private final Map<String, DataSource> dataSourceCache = new HashMap<>(1); |
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.
These maps were originally local variables of method importSqlProcessDefinition
, but they are now private variables of the class, which I think may cause problems
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.
+1, this cannot work since ProcessDefinitionServiceImpl is singloten.
Please retry analysis of this Pull-Request directly on SonarCloud |
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.
I am -1 to this PR, this PR seems only move some code into single method, this cannot reduce complexity.
Purpose of the pull request
For issue #15599
This PR reduces cognitive complexity of ProcessDefinitionServiceImpl in dolphin-scheduler-api.
below methods in this class are covered
Verify this pull request
This pull request is code cleanup without any test coverage.