BlindlyTeam/Blindly

View on GitHub
app/src/main/java/ch/epfl/sdp/blindly/user/User.kt

Summary

Maintainability
A
1 hr
Test Coverage
A
100%

File User.kt has 301 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

package ch.epfl.sdp.blindly.user

import android.util.Log
import ch.epfl.sdp.blindly.utils.Date
import com.google.firebase.firestore.DocumentSnapshot
Severity: Minor
Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt - About 3 hrs to fix

    Method updateUser has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Invalid

            /**
             * Update the field of a User
             *
             * @param T either a String, an Int or a List<*>
             * @param user the user to update
    Severity: Major
    Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt - About 2 hrs to fix

      Method toUser has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              /**
               * Converts the document received from firestore back into a User
               *
               * @return a User
               */
      Severity: Minor
      Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt - About 1 hr to fix

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

                private fun <T> assertIsAgeRange(newValue: T) {
                    if (newValue !is List<*>)
                        throw java.lang.IllegalArgumentException("Expected newValue to be a List<Int>")
                    if (newValue[0] !is Int)
                        throw java.lang.IllegalArgumentException("Expected newValue to be a List<Int>")
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 1 other location - About 3 hrs to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 421..431

        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 211.

        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.
        Invalid

                private fun <T> assertIsLocation(newValue: T) {
                    if (newValue !is List<*>)
                        throw java.lang.IllegalArgumentException("Expected newValue to be a List<Double>")
                    if (newValue[0] !is Double)
                        throw java.lang.IllegalArgumentException("Expected newValue to be a List<Double>")
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 1 other location - About 3 hrs to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 409..419

        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 211.

        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.
        Invalid

                /**
                 * Set the location in the UserBuilder
                 *
                 * @param location the location of the User
                 */
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 1 other location - About 1 hr to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 209..224

        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 135.

        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.
        Invalid

                /**
                 * Set the age range in the UserBuilder
                 *
                 * @param ageRange a list containing the age range :
                 *     ageRange[0] = minAge,
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 1 other location - About 1 hr to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 104..117

        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 135.

        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.
        Invalid

                        MATCHES -> {
                            val newMatches = newValue as List<String>
                            if (newMatches.isNotEmpty()) { //newMatches is a non empty list, the type must be a string
                                assertIsListOfString(newValue)
                            }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 2 other locations - About 1 hr to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 369..375
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 376..382

        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 91.

        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.
        Invalid

                        DISLIKES -> {
                            val newDislikes = newValue as List<String>
                            if (newDislikes.isNotEmpty()) { // newLikes is a non empty list, the type must be a string
                                assertIsListOfString(newValue)
                            }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 2 other locations - About 1 hr to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 362..368
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 369..375

        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 91.

        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.
        Invalid

                        LIKES -> {
                            val newLikes = newValue as List<String>
                            if (newLikes.isNotEmpty()) { // newLikes is a non empty list, the type must be a string
                                assertIsListOfString(newValue)
                            }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 2 other locations - About 1 hr to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 362..368
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 376..382

        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 91.

        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.
        Invalid

                private fun <T> assertIsBoolean(newValue: T) {
                    if (newValue !is Boolean)
                        throw java.lang.IllegalArgumentException("Expected newValue to be a Boolean")
                }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 2 other locations - About 45 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 433..436
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 438..441

        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 77.

        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.
        Invalid

                private fun <T> assertIsString(newValue: T) {
                    if (newValue !is String)
                        throw java.lang.IllegalArgumentException("Expected newValue to be a String")
                }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 2 other locations - About 45 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 438..441
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 443..446

        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 77.

        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.
        Invalid

                private fun <T> assertIsInt(newValue: T) {
                    if (newValue !is Int)
                        throw java.lang.IllegalArgumentException("Expected newValue to be an Int")
                }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 2 other locations - About 45 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 433..436
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 443..446

        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 77.

        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 4 locations. Consider refactoring.
        Invalid

                        AGE_RANGE -> {
                            assertIsAgeRange(newValue)
                            user.ageRange = newValue as List<Int>
                        }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 3 other locations - About 35 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 334..337
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 346..349
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 354..357

        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 63.

        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 4 locations. Consider refactoring.
        Invalid

                        LOCATION -> {
                            assertIsLocation(newValue)
                            user.location = newValue as List<Double>
                        }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 3 other locations - About 35 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 346..349
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 354..357
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 387..390

        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 63.

        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 4 locations. Consider refactoring.
        Invalid

                        SEXUAL_ORIENTATIONS -> {
                            assertIsListOfString(newValue)
                            user.sexualOrientations = newValue as List<String>
                        }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 3 other locations - About 35 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 334..337
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 354..357
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 387..390

        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 63.

        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 4 locations. Consider refactoring.
        Invalid

                        PASSIONS -> {
                            assertIsListOfString(newValue)
                            user.passions = newValue as List<String>
                        }
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 3 other locations - About 35 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 334..337
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 346..349
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 387..390

        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 63.

        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.
        Invalid

                /**
                 * Set the sexual orientations in the UserBuilder
                 *
                 * @param sexualOrientations the sexual orientations of the User
                 */
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 4 other locations - About 30 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 155..162
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 173..180
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 182..189
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 191..198

        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 61.

        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.
        Invalid

                /**
                 * Set the matches in the UserBuilder. Other users are represented by their UID.
                 *
                 * @param matches the matches of the User
                 */
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 4 other locations - About 30 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 137..144
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 155..162
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 182..189
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 191..198

        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 61.

        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.
        Invalid

                /**
                 * Set the dislikes in the UserBuilder
                 *
                 * @param dislikes the dislikes of the User. Other users are represented by their UID.
                 */
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 4 other locations - About 30 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 137..144
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 155..162
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 173..180
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 182..189

        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 61.

        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.
        Invalid

                /**
                 * Set the passions in the UserBuilder
                 *
                 * @param passions the passions of the User
                 */
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 4 other locations - About 30 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 137..144
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 173..180
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 182..189
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 191..198

        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 61.

        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.
        Invalid

                /**
                 * Set the likes in the UserBuilder
                 *
                 * @param likes the likes of the User. Other users are represented by their UID.
                 */
        Severity: Major
        Found in app/src/main/java/ch/epfl/sdp/blindly/user/User.kt and 4 other locations - About 30 mins to fix
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 137..144
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 155..162
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 173..180
        app/src/main/java/ch/epfl/sdp/blindly/user/User.kt on lines 191..198

        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 61.

        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

        There are no issues that match your filters.

        Category
        Status