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) {
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) {
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) {
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 ");
- 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"
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()) {
- 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"
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;
- 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"
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()) {
- 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"
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;
- 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"