treasure-data/embulk-input-marketo

View on GitHub
src/main/java/org/embulk/input/marketo/rest/MarketoBaseRestClient.java

Summary

Maintainability
C
1 day
Test Coverage

Method doRequest has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected <T> T doRequest(final String target, final HttpMethod method, final Map<String, String> headers, final Multimap<String, String> params, final ContentProvider contentProvider, Jetty94ResponseReader<T> responseReader)
    {
        return retryHelper.requestWithRetry(responseReader, new Jetty94SingleRequester()
        {
            @Override

    File MarketoBaseRestClient.java has 266 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package org.embulk.input.marketo.rest;
    
    import com.fasterxml.jackson.databind.ObjectMapper;
    import com.google.common.annotations.VisibleForTesting;
    import com.google.common.collect.ArrayListMultimap;

      Method requestAccessToken has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private String requestAccessToken()
          {
              final Multimap<String, String> params = ArrayListMultimap.create();
              params.put("client_id", clientId.trim());
              params.put("client_secret", clientSecret.trim());

        Method doRequestWithWrappedException has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private <T> T doRequestWithWrappedException(final String target, final HttpMethod method, final Map<String, String> headers, final Multimap<String, String> params, final ContentProvider contentProvider, Jetty94ResponseReader<T> responseReader)
        Severity: Minor
        Found in src/main/java/org/embulk/input/marketo/rest/MarketoBaseRestClient.java - About 45 mins to fix

          Method doRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected <T> T doRequest(final String target, final HttpMethod method, final Map<String, String> headers, final Multimap<String, String> params, final ContentProvider contentProvider, Jetty94ResponseReader<T> responseReader)
          Severity: Minor
          Found in src/main/java/org/embulk/input/marketo/rest/MarketoBaseRestClient.java - About 45 mins to fix

            Method doPost has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                protected <T> T doPost(final String target, final Map<String, String> headers, final Multimap<String, String> params, final String content, Jetty94ResponseReader<T> responseReader)
            Severity: Minor
            Found in src/main/java/org/embulk/input/marketo/rest/MarketoBaseRestClient.java - About 35 mins to fix

              Method doPost has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  protected <T> T doPost(final String target, final Map<String, String> headers, final Multimap<String, String> params, Jetty94ResponseReader<T> responseReader, final ContentProvider content)
              Severity: Minor
              Found in src/main/java/org/embulk/input/marketo/rest/MarketoBaseRestClient.java - About 35 mins to fix

                Method doRequestWithWrappedException has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private <T> T doRequestWithWrappedException(final String target, final HttpMethod method, final Map<String, String> headers, final Multimap<String, String> params, final ContentProvider contentProvider, Jetty94ResponseReader<T> responseReader)
                    {
                        try {
                            return doRequest(target, method, headers, params, contentProvider, responseReader);
                        }
                Severity: Minor
                Found in src/main/java/org/embulk/input/marketo/rest/MarketoBaseRestClient.java - About 35 mins 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

                There are no issues that match your filters.

                Category
                Status