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