Alvaro2112/Money_run

View on GitHub

Showing 28 of 40 total issues

Method joinLobbyFromJoinButton has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static void joinLobbyFromJoinButton(@NonNull GameRepresentation gameRepresentation,
                                               @NonNull DatabaseReference databaseReference,
                                               @NonNull Activity activity,
                                               @NonNull User currentUser,
                                               String locationMode) {
Severity: Minor
Found in app/src/main/java/sdp/moneyrun/Helpers.java - About 35 mins to fix

    Method checkNewGameStringParameters has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private boolean checkNewGameStringParameters(@NonNull String gameName, @NonNull String maxPlayerNumberStr, @NonNull String numCoinsStr, @NonNull String gameRadiusStr, @NonNull String gameDurationStr) {
    Severity: Minor
    Found in app/src/main/java/sdp/moneyrun/menu/NewGameImplementation.java - About 35 mins to fix

      Method onButtonShowQuestionPopupWindowClick has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public void onButtonShowQuestionPopupWindowClick(View view, Boolean focusable, int layoutId, @NonNull Riddle riddle, @Nullable Coin coin) {
      Severity: Minor
      Found in app/src/main/java/sdp/moneyrun/ui/map/MapActivity.java - About 35 mins to fix

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

            public void placeRandomCoins(int number, double maxRadius, double minRadius) {
                if (number < 0 || maxRadius <= 0 || minRadius <= 0)
                    throw new IllegalArgumentException("Number of coins to place is less than 0, number of coin is  " + number);
                if (minRadius >= maxRadius)
                    throw new IllegalArgumentException("Min radius cannot be bigger or equal than max Radius ");
        Severity: Minor
        Found in app/src/main/java/sdp/moneyrun/ui/map/MapActivity.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

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

            public void setPlayers(@Nullable List<Player> players, boolean forceLocal, @NonNull OnCompleteListener listener) {
                if (players == null) {
                    throw new IllegalArgumentException("players should not be null.");
                }
                if (players.isEmpty()) {
        Severity: Minor
        Found in app/src/main/java/sdp/moneyrun/game/Game.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

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

            @Override
            public boolean equals(@Nullable Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                Player player = (Player) o;
        Severity: Minor
        Found in app/src/main/java/sdp/moneyrun/player/Player.java - About 25 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

        Method minDistWithExistingCoins has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static double minDistWithExistingCoins(@NonNull Location loc, @Nullable List<Coin> coins) {
                if (coins == null) {
                    throw new IllegalStateException();
                }
                if (coins.isEmpty()) {
        Severity: Minor
        Found in app/src/main/java/sdp/moneyrun/map/CoinGenerationHelper.java - About 25 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

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

            @Override
            public boolean equals(@Nullable Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                GameDbData gameDbData = (GameDbData) o;
        Severity: Minor
        Found in app/src/main/java/sdp/moneyrun/database/game/GameDbData.java - About 25 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

        Severity
        Category
        Status
        Source
        Language