Skip to content

Conversation

@ARajan1084
Copy link
Contributor

@ARajan1084 ARajan1084 commented Sep 26, 2020

Achintya Rajan

Recursive Merge Sort
Chapter 13
Recursion

Pokemon Project (incomplete)
Chapter 12
Classes & Inheritance

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

reviewdog

src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Battle.java|18 col 9| 'while' is not followed by whitespace.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Battle.java|18 col 9| WhitespaceAround: 'while' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Battle.java|32 col 5| Missing a Javadoc comment.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Battle.java|37 col 57| WhitespaceAround: '-' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Battle.java|37 col 57| WhitespaceAround: '-' is not preceded with whitespace.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Battle.java|41 col 35| WhitespaceAround: '-' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Battle.java|41 col 35| WhitespaceAround: '-' is not preceded with whitespace.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|3| First sentence of Javadoc is missing an ending period.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|8 col 17| Abbreviation in name 'maxHP' must contain no more than '1' consecutive capital letters.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|9 col 17| Abbreviation in name 'currentHP' must contain no more than '1' consecutive capital letters.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|10 col 17| Abbreviation in name 'XP' must contain no more than '1' consecutive capital letters.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|10 col 17| Member name 'XP' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|24| Line is longer than 100 characters (found 101).
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|49| Line is longer than 100 characters (found 109).
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|49 col 41| Abbreviation in name 'maxHP' must contain no more than '1' consecutive capital letters.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|49 col 52| Abbreviation in name 'XP' must contain no more than '1' consecutive capital letters.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|49 col 52| Parameter name 'XP' must match pattern '^a-z?$'.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|73| First sentence of Javadoc is missing an ending period.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|81| Line is longer than 100 characters (found 103).
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|98| First sentence of Javadoc is missing an ending period.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Pokemon.java|114 col 16| Abbreviation in name 'getCurrentHP' must contain no more than '1' consecutive capital letters.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Move.java|3| First sentence of Javadoc is missing an ending period.
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Move.java|25| Line is longer than 100 characters (found 138).
src/com/codefortomorrow/intermediate/chapter12/solutions/pokemon/Move.java|35| First sentence of Javadoc is missing an ending period.
src/com/codefortomorrow/advanced/chapter13/solutions/RecurMergeSort.java|4 col 5| Missing a Javadoc comment.

private Pokemon pokemonTwo;
private int turn;

public Battle (Pokemon pokemonOne, Pokemon pokemonTwo) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

private Pokemon pokemonTwo;
private int turn;

public Battle (Pokemon pokemonOne, Pokemon pokemonTwo) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'(' is preceded with whitespace.

turn = 1;
}

public void runBattle() {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

}

public void runBattle() {
while(true) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'while' is not followed by whitespace.

}

public void runBattle() {
while(true) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
WhitespaceAround: 'while' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)

* @param freezing whether the move freezes
* @param baseDamage base damage of the move
*/
public Move(String name, boolean poisoning, boolean sleeping, boolean paralyzing, boolean burning, boolean freezing, int baseDamage) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Line is longer than 100 characters (found 138).

this.baseDamage = baseDamage;
}

/**

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
First sentence of Javadoc is missing an ending period.

private Pokemon pokemonTwo;
private int turn;

public Battle (Pokemon pokemonOne, Pokemon pokemonTwo) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

private Pokemon pokemonTwo;
private int turn;

public Battle (Pokemon pokemonOne, Pokemon pokemonTwo) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'(' is preceded with whitespace.

turn = 1;
}

public void runBattle() {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

reviewdog

src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|7 col 47| Array brackets at illegal position.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|8 col 9| 'method def lcurly' has incorrect indentation level 8, expected level should be 4.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|8 col 9| '{' at column 9 should be on the previous line.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|9 col 13| 'if' has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|10 col 17| 'if' child has incorrect indentation level 16, expected level should be 12.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|14 col 17| 'if' construct must use '{}'s.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|14 col 17| 'if' has incorrect indentation level 16, expected level should be 12.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|19 col 17| 'if' construct must use '{}'s.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|19 col 17| 'if' has incorrect indentation level 16, expected level should be 12.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|24 col 17| 'if' child has incorrect indentation level 16, expected level should be 12.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|25 col 13| 'if rcurly' has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|29 col 13| 'method def' child has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|30 col 9| 'method def rcurly' has incorrect indentation level 8, expected level should be 4.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|33 col 9| 'method def modifier' has incorrect indentation level 8, expected level should be 4.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|33 col 44| Array brackets at illegal position.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|34 col 9| 'method def lcurly' has incorrect indentation level 8, expected level should be 4.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|34 col 9| '{' at column 9 should be on the previous line.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|35 col 13| 'method def' child has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|35 col 20| Array brackets at illegal position.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|36 col 13| 'method def' child has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|37 col 13| 'method def' child has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|38 col 13| 'method def' child has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|39 col 13| 'if' construct must use '{}'s.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|39 col 13| 'if' has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|41 col 13| 'else' construct must use '{}'s.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|41 col 13| 'else' has incorrect indentation level 12, expected level should be 8.
src/com/codefortomorrow/advanced/chapter13/examples/BinarySearch.java|43 col 9| 'method def rcurly' has incorrect indentation level 8, expected level should be 4.
src/com/codefortomorrow/advanced/chapter13/solutions/RecurMergeSort.java|5 col 5| Missing a Javadoc comment.

private Pokemon pokemonTwo;
private int turn;

public Battle(Pokemon pokemonOne, Pokemon pokemonTwo) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

*/
public Pokemon(
Move[] moveList,
int maxHP,

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Abbreviation in name 'maxHP' must contain no more than '1' consecutive capital letters.

public Pokemon(
Move[] moveList,
int maxHP,
int XP,

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Abbreviation in name 'XP' must contain no more than '1' consecutive capital letters.

public Pokemon(
Move[] moveList,
int maxHP,
int XP,

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Parameter name 'XP' must match pattern '^a-z?$'.

public void attack(Pokemon enemy, int moveIndex) {
// Type your code here
System.out.println(
name +

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'+' should be on a new line.

return name;
}

public int getCurrentHP() {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Abbreviation in name 'getCurrentHP' must contain no more than '1' consecutive capital letters.

@@ -0,0 +1,55 @@
package com.codefortomorrow.intermediate.chapter12.solutions.pokemon;

/**

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
First sentence of Javadoc is missing an ending period.

this.baseDamage = baseDamage;
}

/**

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
First sentence of Javadoc is missing an ending period.

// Java implementation of recursive Binary Search
// Returns index of x if it is present in arr[l..
// r], else return -1
public static int binarySearch(int arr[], int l, int r, int x)

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'method def modifier' has incorrect indentation level 8, expected level should be 4.

// Java implementation of recursive Binary Search
// Returns index of x if it is present in arr[l..
// r], else return -1
public static int binarySearch(int arr[], int l, int r, int x)

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

// Java implementation of recursive Binary Search
// Returns index of x if it is present in arr[l..
// r], else return -1
public static int binarySearch(int arr[], int l, int r, int x) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

// Java implementation of recursive Binary Search
// Returns index of x if it is present in arr[l..
// r], else return -1
public static int binarySearch(int arr[], int l, int r, int x) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Array brackets at illegal position.


// If the element is present at the
// middle itself
if (arr[mid] == x) return mid;

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'if' construct must use '{}'s.


// If element is smaller than mid, then
// it can only be present in left subarray
if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'if' construct must use '{}'s.

}

// Driver method to test above
public static void main(String args[]) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Array brackets at illegal position.

package com.codefortomorrow.advanced.chapter13.examples;

public class Fibonacci {
public static int fibonacciRecursion(int nthNumber) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

return fibonacciRecursion(nthNumber - 1) + fibonacciRecursion(nthNumber - 2);
}

public static int fibonacciLoop(int nthNumber) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.


public static int fibonacciLoop(int nthNumber) {
//use loop
int previouspreviousNumber, previousNumber = 0, currentNumber = 1;

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Each variable declaration must be in its own statement.

public static int fibonacciLoop(int nthNumber) {
//use loop
int previouspreviousNumber, previousNumber = 0, currentNumber = 1;
for (int i = 1; i < nthNumber ; i++) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
';' is preceded with whitespace.


public class RecurMergeSort {

public static void recurMergeSort(Comparable[] array, int start, int end) {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

return 1;
}
return (
fibonacciRecursion(nthNumber - 1) +

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'+' should be on a new line.

return (
fibonacciRecursion(nthNumber - 1) +
fibonacciRecursion(nthNumber - 2)
);

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'method def' child has incorrect indentation level 8, expected level should be 12.


//Second way of reading the file
System.out.println("Reading the file using read() method:");
int num=0;

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
WhitespaceAround: '=' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)


//Second way of reading the file
System.out.println("Reading the file using read() method:");
int num=0;

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
WhitespaceAround: '=' is not preceded with whitespace.

System.out.println("Reading the file using read() method:");
int num=0;
char ch;
while((num=br2.read()) != -1)

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'while' is not followed by whitespace.

char ch;
while((num=br2.read()) != -1)
{
ch=(char)num;

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
WhitespaceAround: '=' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)

char ch;
while((num=br2.read()) != -1)
{
ch=(char)num;

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
WhitespaceAround: '=' is not preceded with whitespace.

char ch;
while((num=br2.read()) != -1)
{
ch=(char)num;

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'typecast' is not followed by whitespace.

System.out.print(ch);
}

}

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'}' at column 9 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).


}
catch (IOException ioe)
{

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
'{' at column 9 should be on the previous line.

System.out.println("Welcome to Account Creation!");
while (true) {
System.out.print("Enter username (4 to 10 characters): ");
String username = sc.next();

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Distance between variable 'username' declaration and its first usage is 4, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value).


}

public static void createAccount(String username, String password, int age, String confirmPassword) throws

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Line is longer than 100 characters (found 110).

}

public static void createAccount(String username, String password, int age, String confirmPassword) throws
InvalidAgeException, InvalidPasswordException, InvalidUsernameException, PasswordMismatchException {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Line is longer than 100 characters (found 112).


}

public static void createAccount(String username, String password, int age, String confirmPassword) throws

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Line is longer than 100 characters (found 110).


}

public static void createAccount(String username, String password, int age, String confirmPassword) throws

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

}

public static void createAccount(String username, String password, int age, String confirmPassword) throws
InvalidAgeException, InvalidPasswordException, InvalidUsernameException, PasswordMismatchException {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Line is longer than 100 characters (found 112).

@ARajan1084 ARajan1084 requested review from JJ27 and neha-peddinti and removed request for AlveeraMunshi September 27, 2020 21:45
Copy link
Contributor

@neha-peddinti neha-peddinti left a comment

Choose a reason for hiding this comment

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

Looks good!

int age,
String confirmPassword
)
throws InvalidAgeException, InvalidPasswordException, InvalidUsernameException, PasswordMismatchException {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Line is longer than 100 characters (found 115).

}
}

public static void createAccount(

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Missing a Javadoc comment.

int age,
String confirmPassword
)
throws InvalidAgeException, InvalidPasswordException, InvalidUsernameException, PasswordMismatchException {

Choose a reason for hiding this comment

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

[reviewdog] reported by reviewdog 🐶
Line is longer than 100 characters (found 115).

Copy link
Contributor

@JJ27 JJ27 left a comment

Choose a reason for hiding this comment

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

Everything looks good, I like the Pokémon project!

@ARajan1084 ARajan1084 merged commit 63bb7f6 into master Sep 28, 2020
@ARajan1084 ARajan1084 deleted the ch13-achintya branch September 28, 2020 04:08
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.

4 participants