Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hazel branch #24

Open
wants to merge 110 commits into
base: master
Choose a base branch
from
Open

Hazel branch #24

wants to merge 110 commits into from

Conversation

smartist17
Copy link

No description provided.

d.printErrorMessage();
}

if(currentPlayer.getName() != "TIMBERDOODLE72"){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I detect that this code is problematic. According to the Bad practice (BAD_PRACTICE), ES: Comparison of String objects using == or != (ES_COMPARING_STRINGS_WITH_EQ).
This code compares java.lang.String objects for reference equality using the == or != operators. Unless both strings are either constants in a source file, or have been interned using the String.intern() method, the same string value may be represented by two different String objects. Consider using the equals(Object) method instead.

}

public void getRankToAskFor_Computer() {
int pickCard = (int) Math.random() * (this.dealersHand.size() - 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I detect that this code is problematic. According to the Correctness (CORRECTNESS), RV: Random value from 0 to 1 is coerced to the integer 0 (RV_01_TO_INT).
A random value from 0 to 1 is being coerced to the integer value 0. You probably want to multiply the random value by something else before coercing it to an integer, or use the Random.nextInt(n) method.

}

@Test
public void TestGetValueOfCard() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I detect that this code is problematic. According to the Bad practice (BAD_PRACTICE), Nm: Method names should start with a lower case letter (NM_METHOD_NAMING_CONVENTION).
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants