src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java
Method isResponseStatusToRetry
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
private boolean isResponseStatusToRetry(final int status, final String message, final int retryAfter, final boolean isPreview)
{
if (status == HttpStatus.SC_NOT_FOUND) {
ObjectMapper objectMapper = new ObjectMapper();
try {
- 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 doGet
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public String doGet(final String url, final PluginTask task, final boolean isPreview)
{
target = task.getTarget();
loginURL = task.getLoginUrl();
Method isResponseStatusToRetry
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private boolean isResponseStatusToRetry(final int status, final String message, final int retryAfter, final boolean isPreview)
{
if (status == HttpStatus.SC_NOT_FOUND) {
ObjectMapper objectMapper = new ObjectMapper();
try {
File ZendeskRestClient.java
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package org.embulk.input.zendesk.clients;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
Method sendGetRequest
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
private String sendGetRequest(final String url, final PluginTask task)
throws ZendeskException
{
try {
final HttpClient client = createHttpClient();
- 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 sendGetRequest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private String sendGetRequest(final String url, final PluginTask task)
throws ZendeskException
{
try {
final HttpClient client = createHttpClient();
Avoid too many return
statements within this method. Open
Open
return true;