Showing 9 of 10 total issues
ReminderUseCase
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class ReminderUseCase implements AutoCloseable {
private static final String ACTION_DATA_REQUEST_REMINDER_CANCELLATION =
"ACTION_DATA_REQUEST_REMINDER_CANCELLATION";
private static final String ACTION_DATA_REQUEST_ACCESS_TOKEN_COMPLETION =
File ReminderUseCase.java
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package com.mizo0203.lilywhite.domain;
import com.linecorp.bot.model.action.Action;
import com.linecorp.bot.model.action.DatetimePickerAction;
import com.linecorp.bot.model.action.PostbackAction;
Method notify
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void notify(
@Nonnull String access_token,
@Nonnull String message,
@Nullable String imageThumbnail,
@Nullable String imageFullsize,
Method tokenOauth
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void tokenOauth(
String code,
String client_id,
String client_secret,
@Nonnull Callback<AccessToken> callback) {
Method post
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void post(
URL url, Map<String, String> reqProp, @Nonnull String body, Callback callback) {
LOG.info("post url: " + url);
LOG.info("post reqProp: " + reqProp);
LOG.info("post body: " + body);
Method status
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void status(@Nonnull String access_token, @Nonnull Callback<ResponseStatusData> callback) {
Map<String, String> reqProp = new HashMap<>();
reqProp.put("Authorization", "Bearer " + access_token);
try {
Method revoke
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void revoke(@Nonnull String access_token, @Nonnull Callback<ResponseRevokeData> callback) {
Map<String, String> reqProp = new HashMap<>();
reqProp.put("Content-Type", "application/x-www-form-urlencoded");
reqProp.put("Authorization", "Bearer " + access_token);
Method notify
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
@Nonnull String access_token,
@Nonnull String message,
@Nullable String imageThumbnail,
@Nullable String imageFullsize,
@Nullable String imageFile,
Method onLinePostBack
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private void onLinePostBack(PostbackEvent event) {
if (State.NO_NICKNAME.equals(mState)) {
return;
}
try (ReminderUseCase reminderUseCase = new ReminderUseCase(mRepository, mConfig)) {
- 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"