diff --git a/analyzer-comments/java/cars-assemble/avoid_using_return_in_else_statement.md b/analyzer-comments/java/cars-assemble/avoid_using_return_in_else_statement.md new file mode 100644 index 000000000..f2562ecc7 --- /dev/null +++ b/analyzer-comments/java/cars-assemble/avoid_using_return_in_else_statement.md @@ -0,0 +1,3 @@ +# avoid using return in else statement +When an `if` block ends with a return statement, the subsequent `else` is redundant. +Removing the `else` can make the code cleaner and easier to read. diff --git a/analyzer-comments/java/cars-assemble/prefer_storing_constant_in_field.md b/analyzer-comments/java/cars-assemble/prefer_storing_constant_in_field.md new file mode 100644 index 000000000..732b36b8f --- /dev/null +++ b/analyzer-comments/java/cars-assemble/prefer_storing_constant_in_field.md @@ -0,0 +1,3 @@ +# prefer storing constant in field +The value 221 is a magic number: a hard-coded constant without explanation. +To improve readability and maintainability, replace repeated or unexplained values with a named constant. \ No newline at end of file diff --git a/analyzer-comments/java/wizards-and-warriors-2/reuse_code_from_describe_three_params.md b/analyzer-comments/java/wizards-and-warriors-2/reuse_code_from_describe_three_params.md new file mode 100644 index 000000000..186cb27bd --- /dev/null +++ b/analyzer-comments/java/wizards-and-warriors-2/reuse_code_from_describe_three_params.md @@ -0,0 +1,3 @@ +# Reuse code from Describe three params + +The `describe(Character, Destination, TravelMethod)` method should reuse the logic implemented in `describe(Character)`, `describe(Destination)` and `describe(TravelMethod)`. Reusing existing methods can help make code easier to maintain. diff --git a/analyzer-comments/java/wizards-and-warriors-2/reuse_code_from_describe_two_params.md b/analyzer-comments/java/wizards-and-warriors-2/reuse_code_from_describe_two_params.md new file mode 100644 index 000000000..2f45df58e --- /dev/null +++ b/analyzer-comments/java/wizards-and-warriors-2/reuse_code_from_describe_two_params.md @@ -0,0 +1,4 @@ +# Reuse code from Describe two params + +The `describe(Character, Destination)` method should reuse the logic implemented in `describe(Character, Destination, TravelMethod)` or in the individual methods `describe(Character)`, `describe(Destination)`, `describe(TravelMethod)`. +Reusing existing methods can help make code easier to maintain. \ No newline at end of file