treasure-data/embulk-input-zendesk

View on GitHub
src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java

Summary

Maintainability
D
1 day
Test Coverage

Method isResponseStatusToRetry has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
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 {
Severity: Minor
Found in src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java - About 4 hrs to fix

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

    public String doGet(final String url, final PluginTask task, final boolean isPreview)
    {
        target = task.getTarget();
        loginURL = task.getLoginUrl();

Severity: Major
Found in src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java - About 2 hrs to fix

    Method isResponseStatusToRetry has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    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 {
    Severity: Major
    Found in src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java - About 2 hrs to fix

      File ZendeskRestClient.java has 256 lines of code (exceeds 250 allowed). Consider refactoring.
      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;
      Severity: Minor
      Found in src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java - About 2 hrs to fix

        Method sendGetRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private String sendGetRequest(final String url, final PluginTask task)
                throws ZendeskException
            {
                try {
                    final HttpClient client = createHttpClient();

        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

            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

                  return true;
          Severity: Major
          Found in src/main/java/org/embulk/input/zendesk/clients/ZendeskRestClient.java - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status