cs-http-client/src/main/java/io/cloudslang/content/httpclient/actions/HttpClientAction.java
Method execute
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
Open
@Action(name = "Http Client",
outputs = {
@Output(EXCEPTION),
@Output(STATUS_CODE),
@Output(FINAL_LOCATION),
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method execute
has 49 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
@Param(value = HttpClientInputs.URL, required = true) String url,
@Param(HttpClientInputs.TLS_VERSION) String tlsVersion,
@Param(HttpClientInputs.ALLOWED_CYPHERS) String allowedCyphers,
@Param(HttpClientInputs.AUTH_TYPE) String authType,
@Param(HttpClientInputs.PREEMPTIVE_AUTH) String preemptiveAuth,
Method execute
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Action(name = "Http Client",
outputs = {
@Output(EXCEPTION),
@Output(STATUS_CODE),
@Output(FINAL_LOCATION),
Avoid deeply nested control flow statements. Open
Open
if (protocol.toUpperCase().equals(TLSv13.toUpperCase()))
tls13 = protocol;
Avoid deeply nested control flow statements. Open
Open
if (protocol.toUpperCase().equals(TLSv12.toUpperCase()))
tls12 = protocol;
Avoid too many return
statements within this method. Open
Open
return exceptionResult(e.getMessage(), e);
Avoid too many return
statements within this method. Open
Open
return exceptionResult(e.getMessage(), e);
Avoid too many return
statements within this method. Open
Open
return new HttpClientService().execute(httpClientInputs);
Avoid too many return
statements within this method. Open
Open
return new HttpClientService().execute(httpClientInputs);
Avoid too many return
statements within this method. Open
Open
return new HttpClientService().execute(httpClientInputs);
Avoid too many return
statements within this method. Open
Open
return new HttpClientService().execute(httpClientInputs);
Avoid too many return
statements within this method. Open
Open
return new HttpClientService().execute(httpClientInputs);
Avoid too many return
statements within this method. Open
Open
return exceptionResult(ex.getMessage(), exe);
Avoid too many return
statements within this method. Open
Open
return exceptionResult(ex.getMessage(), ex);
Avoid too many return
statements within this method. Open
Open
return new HttpClientService().execute(httpClientInputs);