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

[244] address sonar issues in wildfly/cdk bundles #303

Merged
merged 1 commit into from
Apr 23, 2019

Conversation

adietish
Copy link
Contributor

@adietish adietish commented Apr 23, 2019

this is part of the effort for issue #244

@@ -52,7 +52,7 @@
private static final Logger LOG = LoggerFactory.getLogger(URLTransportCache.class);

private static final int DEFAULT_CONNECT_TIMEOUT = 1 * 60 * 1000;
private static final int DEFAULT_READ_TIMEOUT = 2 * 60 * 1000;
private static final int DEFAULT_READ_TIMEOUT = (int)(0.1 * 60 * 1000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this intentional, to change the read timeout from 60 seconds to 6 seconds?

Copy link
Contributor Author

@adietish adietish Apr 23, 2019

Choose a reason for hiding this comment

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

no wasnt, my bad. Reverting it. I most likely introduced this when I started writing tests and forgot to revert it.

return "CDK";
}
if( props != null
&& props.getCDKVersion() != null ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

couldn't this be on one line? if( props != null && props.getCDKVersion() != null ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer to separate both condition to the max and thus having every condition on a separate line

@@ -55,7 +60,8 @@ public static int getWorkflowStatus(DownloadRuntime dr, String userS, String pas
if (response == 401) {
// 401 means bad credentials, change nothing
return CREDENTIALS_FAILED;
} else if (response == 403 || response == 200) {
} else if (response == 403
|| response == 200) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does it move this to a new line? It's not even very long :( I hate automatic code formatters :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this, too. On purpose. Like you prefer not to immediately return a value but to store in a temporary variable and only return afterwards: I prefer to have every condition on it's own line and get better readable imho.

@codecov
Copy link

codecov bot commented Apr 23, 2019

Codecov Report

Merging #303 into master will increase coverage by 0.3%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #303     +/-   ##
===========================================
+ Coverage     31.05%   31.35%   +0.3%     
- Complexity     1378     1389     +11     
===========================================
  Files           298      298             
  Lines         11302    11302             
  Branches       1590     1593      +3     
===========================================
+ Hits           3510     3544     +34     
+ Misses         7347     7310     -37     
- Partials        445      448      +3
Impacted Files Coverage Δ Complexity Δ
...ype/capabilities/JBossEAP60ExtendedProperties.java 25% <ø> (ø) 2 <0> (ø) ⬇️
...ype/launch/JBoss72Eap61DefaultLaunchArguments.java 40% <ø> (ø) 1 <0> (ø) ⬇️
...ildfly/servertype/launch/JBossEAP60LaunchArgs.java 66.66% <ø> (ø) 1 <0> (ø) ⬇️
...rtype/launch/JBossEAP70DefaultLaunchArguments.java 33.33% <ø> (ø) 1 <0> (ø) ⬇️
...rvertype/launch/JBoss6xDefaultLaunchArguments.java 18.18% <ø> (ø) 1 <0> (ø) ⬇️
...ildfly/servertype/AbstractJBossServerDelegate.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...rtype/launch/JBossEAP72DefaultLaunchArguments.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ype/capabilities/JBossEAP61ExtendedProperties.java 42.85% <ø> (ø) 2 <0> (ø) ⬇️
.../wildfly/servertype/capabilities/util/IP6Util.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...inishift/servertype/impl/MinishiftServerTypes.java 0% <ø> (ø) 0 <0> (ø) ⬇️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e55f73...c5f7aee. Read the comment docs.

@robstryker
Copy link
Collaborator

If you just verify the DEFAULT_READ_TIMEOUT situation, I can +1. That timeout change seems iffy to me though.

@adietish
Copy link
Contributor Author

@robstryker corrected the timeout, please re-review.

@robstryker robstryker merged commit 570e418 into redhat-developer:master Apr 23, 2019
@mohitsuman mohitsuman removed the review label Apr 23, 2019
@adietish adietish deleted the issue-244 branch April 24, 2019 17:21
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.

3 participants