DishDelish/dishdelish-app

View on GitHub

Showing 92 of 120 total issues

Method getAuth has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static FirebaseAuth getAuth() {
        FirebaseAuth auth = FirebaseAuth.getInstance();

        if (emulator) {
            try {

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

Method onCreate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        askLocationPermission();
        askNotificationPermission();
Severity: Minor
Found in app/src/main/java/com/github/siela1915/bootcamp/NearbyHelpFragment.java - About 35 mins 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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    public static NearbyHelpFragment newInstance(List<Ingredient> askedIngredients) {
        NearbyHelpFragment fragment = new NearbyHelpFragment();
        Bundle args = new Bundle();
        args.putParcelableArrayList(ARG_ASKED_INGREDIENTS, new ArrayList<>(askedIngredients));
        fragment.setArguments(args);
app/src/main/java/com/github/siela1915/bootcamp/HomePageFragment.java on lines 90..96
app/src/main/java/com/github/siela1915/bootcamp/RecipeListFragment.java on lines 36..42

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public List<String> sortByCarbohydrates(List<Recipe> recipes) {
        Objects.requireNonNull(recipes);
        return recipes.stream().sorted(Comparator.comparingDouble(Recipe::getCarbohydrates)).map(r -> r.uniqueKey).collect(Collectors.toList());
    }
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 140..143
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 150..153
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 170..173
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 180..183

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public List<String> sortBySugar(List<Recipe> recipes) {
        Objects.requireNonNull(recipes);
        return recipes.stream().sorted(Comparator.comparingDouble(Recipe::getSugar)).map(r -> r.uniqueKey).collect(Collectors.toList());
    }
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 140..143
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 150..153
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 160..163
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 170..173

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public List<String> sortByProtein(List<Recipe> recipes) {
        Objects.requireNonNull(recipes);
        return recipes.stream().sorted(Comparator.comparingDouble(Recipe::getProtein)).map(r -> r.uniqueKey).collect(Collectors.toList());
    }
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 150..153
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 160..163
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 170..173
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 180..183

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public List<String> sortByFat(List<Recipe> recipes) {
        Objects.requireNonNull(recipes);
        return recipes.stream().sorted(Comparator.comparingDouble(Recipe::getFat)).map(r -> r.uniqueKey).collect(Collectors.toList());
    }
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 140..143
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 160..163
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 170..173
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 180..183

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public List<String> sortByCalories(List<Recipe> recipes) {
        Objects.requireNonNull(recipes);
        return recipes.stream().sorted(Comparator.comparingDouble(Recipe::getCalories)).map(r -> r.uniqueKey).collect(Collectors.toList());
    }
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 140..143
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 150..153
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 160..163
app/src/main/java/com/github/siela1915/bootcamp/Labelling/RecipeFetcher.java on lines 180..183

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    public static List<Recipe> getCuisine(CuisineType cuisine, List<Recipe> ls) {
        return ls.stream().filter(r -> r.getCuisineTypes() != null && r.getCuisineTypes().contains(cuisine.ordinal()))
                .collect(Collectors.toList());
    }
app/src/main/java/com/github/siela1915/bootcamp/Tools/Utilities.java on lines 20..23
app/src/main/java/com/github/siela1915/bootcamp/Tools/Utilities.java on lines 31..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 43.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    public static List<Recipe> getDiet(DietType diet, List<Recipe> ls) {
        return ls.stream().filter(r -> r.getDietTypes() != null && r.getDietTypes().contains(diet.ordinal()))
                .collect(Collectors.toList());
    }
app/src/main/java/com/github/siela1915/bootcamp/Tools/Utilities.java on lines 20..23
app/src/main/java/com/github/siela1915/bootcamp/Tools/Utilities.java on lines 42..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 43.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    public static List<Recipe> getAllergy(AllergyType allergy, List<Recipe> ls) {
        return ls.stream().filter(r -> r.getAllergyTypes() != null && r.getAllergyTypes().contains(allergy.ordinal()))
                .collect(Collectors.toList());
    }
app/src/main/java/com/github/siela1915/bootcamp/Tools/Utilities.java on lines 31..34
app/src/main/java/com/github/siela1915/bootcamp/Tools/Utilities.java on lines 42..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 43.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

                .continueWith(offersTask -> {
                    List<Integer> indexes = new ArrayList<>();
                    for (DataSnapshot ds : offersTask.getResult().getChildren()) {
                        indexes.add(ds.getValue(Integer.class));
                    }
app/src/main/java/com/github/siela1915/bootcamp/firebase/Database.java on lines 342..348
app/src/main/java/com/github/siela1915/bootcamp/firebase/Database.java on lines 426..433

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

        ((TextView) timerEditorDialogView.findViewById(R.id.timerEditTitleName)).setText(getResources().getString(R.string.cook_now_timer_item_title) + " " + (index + 1));
app/src/main/java/com/github/siela1915/bootcamp/TimerEditorDialog.java on lines 94..94
app/src/main/java/com/github/siela1915/bootcamp/TimerEditorDialog.java on lines 121..121

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public static NearbyHelpFragment newInstance(Ingredient askedIngredient) {
        NearbyHelpFragment fragment = new NearbyHelpFragment();
        Bundle args = new Bundle();
        args.putParcelable(ARG_ASKED_INGREDIENT, askedIngredient);
        fragment.setArguments(args);
app/src/main/java/com/github/siela1915/bootcamp/FragmentIngredientCheckContainer.java on lines 35..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

        return task.continueWith(snapshot -> {
            List<Recipe> recipes = new ArrayList<>();
            for (DataSnapshot s : snapshot.getResult().getChildren()) {
                recipes.add(s.getValue(Recipe.class));
            }
app/src/main/java/com/github/siela1915/bootcamp/firebase/Database.java on lines 426..433
app/src/main/java/com/github/siela1915/bootcamp/firebase/LocationDatabase.java on lines 87..93

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (isChecked) {
                addToListButton.setBackground(ContextCompat.getDrawable(itemView.getContext(), R.drawable.ic_minus_circle_full));
                addToListButton.setTag("added");
                shoppingListManager.addIngredient(ingredientName.getText().toString());
            } else {
app/src/main/java/com/github/siela1915/bootcamp/IngredientViewHolder.java on lines 31..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

        ((TextView) timerEditorDialogView.findViewById(R.id.timerCreateTitleName)).setText(getResources().getString(R.string.cook_now_timer_item_title) + " " + (index + 1));
app/src/main/java/com/github/siela1915/bootcamp/TimerEditorDialog.java on lines 94..94
app/src/main/java/com/github/siela1915/bootcamp/TimerEditorDialog.java on lines 165..165

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

                .continueWith(dataTask -> {
                    List<Ingredient> list = new ArrayList<>();
                    for (DataSnapshot ds : dataTask.getResult().getChildren()) {
                        list.add(ds.getValue(Ingredient.class));
                    }
app/src/main/java/com/github/siela1915/bootcamp/firebase/Database.java on lines 342..348
app/src/main/java/com/github/siela1915/bootcamp/firebase/LocationDatabase.java on lines 87..93

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

        ((TextView) timer.findViewById(R.id.timerName)).setText(getResources().getString(R.string.cook_now_timer_item_title) + " " + (index + 1));
app/src/main/java/com/github/siela1915/bootcamp/TimerEditorDialog.java on lines 121..121
app/src/main/java/com/github/siela1915/bootcamp/TimerEditorDialog.java on lines 165..165

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public static FragmentIngredientCheckContainer newInstance(ArrayList<Ingredient> ingList) {
        FragmentIngredientCheckContainer fragment = new FragmentIngredientCheckContainer();
        Bundle args = new Bundle();
        args.putParcelableArrayList(ingredients, ingList);
        fragment.setArguments(args);
app/src/main/java/com/github/siela1915/bootcamp/NearbyHelpFragment.java on lines 108..114

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language