paypay/paypayopa-sdk-java

View on GitHub
src/main/java/jp/ne/paypay/ApiClient.java

Summary

Maintainability
D
2 days
Test Coverage
B
83%

File ApiClient.java has 493 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package jp.ne.paypay;

import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.FormEncodingBuilder;
Severity: Minor
Found in src/main/java/jp/ne/paypay/ApiClient.java - About 7 hrs to fix

    ApiClient has 49 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class ApiClient {
    
        private String basePath = ApiConstants.DEFAULT_BASE_PATH;
        private String basePathProd = ApiConstants.PROD_BASE_PATH;
        private String basePathSandbox = ApiConstants.SANDBOX_BASE_PATH;
    Severity: Minor
    Found in src/main/java/jp/ne/paypay/ApiClient.java - About 6 hrs to fix

      Method deserialize has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @SuppressWarnings("unchecked")
          public <T> T deserialize(Response response, Type returnType) throws ApiException {
              if (response == null || returnType == null) {
                  return null;
              }
      Severity: Minor
      Found in src/main/java/jp/ne/paypay/ApiClient.java - About 1 hr to fix

        Method buildUrl has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams) {
                final StringBuilder url = new StringBuilder();
                url.append(basePath).append(path);
        
                if (queryParams != null && !queryParams.isEmpty()) {
        Severity: Minor
        Found in src/main/java/jp/ne/paypay/ApiClient.java - About 1 hr to fix

          Method prepareDownloadFile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public File prepareDownloadFile(Response response) throws IOException {
                  String filename = null;
                  String contentDisposition = response.header("Content-Disposition");
                  if (contentDisposition != null && !"".equals(contentDisposition)) {
                      // Get filename from the Content-Disposition header.
          Severity: Minor
          Found in src/main/java/jp/ne/paypay/ApiClient.java - About 1 hr to fix

            Avoid too many return statements within this method.
            Open

                        return (T) respBody;
            Severity: Major
            Found in src/main/java/jp/ne/paypay/ApiClient.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return json.deserialize(respBody, returnType);
              Severity: Major
              Found in src/main/java/jp/ne/paypay/ApiClient.java - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status