DishDelish/dishdelish-app

View on GitHub
app/src/main/java/com/github/siela1915/bootcamp/Recipes/Recipe.java

Summary

Maintainability
D
2 days
Test Coverage
A
98%

Recipe has 54 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Recipe implements Parcelable {
    public String image, recipeName, userName, uniqueKey = "";
    public String userId = "";
    public int profilePicture, prepTime, cookTime, servings, likes, numRatings = 0;
    public double rating;
Severity: Major
Found in app/src/main/java/com/github/siela1915/bootcamp/Recipes/Recipe.java - About 7 hrs to fix

    Consider simplifying this complex logical expression.
    Open

            if (obj instanceof Recipe) {
                Recipe recipe = (Recipe) obj;
                boolean temp0 = Objects.equals(image, recipe.image)
                        && recipeName.equals(recipe.recipeName)
                        && userName.equals(recipe.userName);
    Severity: Critical
    Found in app/src/main/java/com/github/siela1915/bootcamp/Recipes/Recipe.java - About 4 hrs to fix

      Method equals has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public boolean equals(Object obj) {
              if (obj instanceof Recipe) {
                  Recipe recipe = (Recipe) obj;
                  boolean temp0 = Objects.equals(image, recipe.image)
      Severity: Minor
      Found in app/src/main/java/com/github/siela1915/bootcamp/Recipes/Recipe.java - About 2 hrs 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

      File Recipe.java has 268 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package com.github.siela1915.bootcamp.Recipes;
      
      import android.os.Parcel;
      import android.os.Parcelable;
      
      
      Severity: Minor
      Found in app/src/main/java/com/github/siela1915/bootcamp/Recipes/Recipe.java - About 2 hrs to fix

        There are no issues that match your filters.

        Category
        Status