src/main/java/jp/ne/paypay/ApiClient.java
File ApiClient.java
has 493 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package jp.ne.paypay;
import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.FormEncodingBuilder;
ApiClient
has 49 methods (exceeds 20 allowed). Consider refactoring. Open
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;
Method deserialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("unchecked")
public <T> T deserialize(Response response, Type returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
}
Method buildUrl
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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()) {
Method prepareDownloadFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.
Avoid too many return
statements within this method. Open
Open
return (T) respBody;
Avoid too many return
statements within this method. Open
Open
return json.deserialize(respBody, returnType);