Showing 5 of 43 total issues
Method generateTestMedicine
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void generateTestMedicine() {
TestMedicine[] testMedicines = new TestMedicine[]{
new TestMedicine("Omega 3 (EPA/DHA 500mg)", null, 1, new TestReminder[]{
new TestReminder("1", 9 * 60, 1, 0, ""),
new TestReminder("1", 18 * 60, 2, 2, "after meals")
Method onChildDrawOver
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void onChildDrawOver(@NonNull Canvas c, @NonNull RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder, float dX, float dY,
int actionState, boolean isCurrentlyActive) {
Method schedule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected void schedule(Instant timestamp, int reminderId, String medicineName, int requestCode, int reminderEventId) {
Method clearCanvas
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private void clearCanvas(Canvas c, float left, float top, float right, float bottom) {
Method doWork
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
@NonNull
@Override
public Result doWork() {
Result r = Result.failure();
Log.i(LogTags.REMINDER, "Do reminder work");
- 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"