Conversation
chrisjamiecarter
left a comment
There was a problem hiding this comment.
Hey @DSills735 👋,
Excellent work on your Flashcards project submission 🎉!
I have performed a peer review. Review/ignore any comments as you wish.
Overview
This submission is incomplete - the project lacks essential build files (.csproj, .sln), cannot be built, and has no README file. These are mandatory requirements for C# Academy project submissions.
🔴 Project Incomplete - No Build Files
💡 The project is missing essential build files (.csproj, .sln). Without these, the project cannot be built or tested. A complete C# project requires at least one .csproj file with proper configuration.
🔴 No README File
💡 No README.md file exists in the project. C# Academy projects require a README explaining how to run the application and its features.
🔴 Missing Input Validation
💡 No validation on resp (user input for stack ID). The code uses Console.ReadLine()! without checking for null or empty input, which could cause issues.
🔴 IDisposable Resource Not Disposed
💡 SqlConnection is created but never disposed. Should use a using declaration or statement to properly handle the connection lifecycle.
🔴 Project Submission
💡 Please place all your code inside a single top-level folder named: [ProjectName].[UserName].
👨🏫 Example: ProjectName.UserName
📁 CodeReviews.Console.Flashcards ⬅️ Forked repo
┣ 📄 .codacy.yml
┣ 📄 .gitignore
┣ 📁 Flashcards.dsills735 ⬅️ Top-level folder
┃ ┗ 📄 Project.sln
┃ ┗ 📄 README.md
┃ ┗ 📁 Flashcards.Console
💭 This helps me clearly identify your work and confirms you can work within community repository guidelines.
Required Actions
Please fix any 🔴 items, as they block approval. Commit and push your changes, then leave me a comment when done! 🔧
Thanks,
@chrisjamiecarter 👍
|
@chrisjamiecarter I really appreciate the review! I believe I hit all your points. I added the running information to the bottom of the readme. To be completely honest, I have no idea how the csproj and sln files did not get included.. I replaced the entire project and it seems to be working fine now. I think I maybe included one too many folders In my initial submission. Lastly, I believe I handled the IDisposable correctly now.. (I just added the using statement to all of the SqlConnection calls). Im not 100% sure if that is all I needed to do in regards to that. Once again, thank you! |
chrisjamiecarter
left a comment
There was a problem hiding this comment.
Hey @DSills735 👋,
Excellent work on your Flashcards project submission 🎉!
I have performed a peer review. Review/ignore any comments as you wish.
Your project demonstrates solid use of Dapper ORM, Spectre.Console for UI, and good separation of concerns through multiple namespaces. The use of DTOs to hide internal IDs is excellent. The code compiles with only warnings (mostly nullable reference types) which is good for a .NET 10 project.
🟢 Good things:
- Good use of DTOs to hide internal IDs from users
- Proper use of parameterized SQL queries to prevent SQL injection
- Good separation of concerns with distinct folders for Menus, Card_Ops, Stack_Ops, Validation, etc.
- Database initialization with proper foreign key with ON DELETE CASCADE
🔴 Project Structure
Apologies, I do not know whether this is a difficult requirement to follow, but I was expecting this, but got this.
Expected
📁 CodeReviews.Console.Flashcards ⬅️ This is the cloned repo
┣ 📄 .codacy.yml
┣ 📄 .gitignore
┣ 📁 Flashcards.DSills735 ⬅️ This should be a new folder created by you manually.
┃ ┗ 📄 Project.sln ⬅️ Your solution file
┃ ┗ 📄 README.md ⬅️ Your README file
┃ ┗ 📁 Flashcards.Console ⬅️ Your solution project directories
Actual
📁 CodeReviews.Console.Flashcards ⬅️ This is the cloned repo
┣ 📄 .codacy.yml
┣ 📄 .gitignore
┣ 📄 README.md ❗ Your README is not for the repo, so should not be here
┣ 📄 Flashcards.slnx ❗ Your solution file is not in your project submission folder
┣ 📁 Flashcards.DSills735 ❗ This is actually your solution project directory, not a project submission directory.
🔴 Missing Requirement
💡 This project is about teaching DTOs. You should be using an imaginary incrementing ID here, instead of the actual database ID. (Note you will still need the DB ID to update/delete)
🔧 Next Steps
- Please fix any 🔴 items, as they block approval.
- Commit and push your changes, then leave me a comment when done.
- Feel free to reach out if you have any questions or want to discuss further 🆘.
Thanks,
@chrisjamiecarter 👍
Flashcards.dsills735/Program.cs
Outdated
|
|
||
| static void Main(string[] args) | ||
| { | ||
| SqlConnection connection = new SqlConnection(connectionString); |
There was a problem hiding this comment.
🟠 Missing using statement for IDisposable
💡 SqlConnection is not properly disposed with a using statement. Use: using SqlConnection connection = new SqlConnection(connectionString);
Flashcards.dsills735/Program.cs
Outdated
| using Flashcards.Menus; | ||
|
|
||
|
|
||
| namespace Program |
There was a problem hiding this comment.
🟠 Incorrect namespace convention
💡 The namespace Program is incorrect. Consider renaming to Flashcards/ Flashcards.Console / Flashcards.UI or a more descriptive namespace.
|
|
||
| internal static string ConnString() | ||
| { | ||
| string? connectionString = Program.Program.config.GetConnectionString("DefaultConnection"); |
There was a problem hiding this comment.
🔵 Potential null reference warning
💡 The connectionString could be null (CS8603). The method returns a nullable string but it's assigned to a non-nullable type in calling code.
|
|
||
|
|
||
| string subj = Console.ReadLine(); | ||
| int stackID = Convert.ToInt32(subj); |
Flashcards.dsills735/Study/Quiz.cs
Outdated
|
|
||
|
|
||
|
|
||
| while (!exists) |
There was a problem hiding this comment.
🟠 Logic issue - loop always executes
💡 The while loop checks for stack existence but the quiz logic is inside the loop - if stack doesn't exist, it loops infinitely asking for input without checking again.
| using SqlConnection connection = new SqlConnection(connectionString); | ||
|
|
||
|
|
||
| var stacks = connection.Query(SqlHelper.ReturnEntireStackWithStackID(), new {StackID = id}).ToList(); | ||
|
|
||
|
|
||
| var table = new Table() |
There was a problem hiding this comment.
🟡 Too Much Whitespace
💡 Code should be separated by one blank line maximum. Keeps code readability and maintainability high.
| internal static string AddToHistory() | ||
| { | ||
| return @"INSERT INTO History(Date, Score) | ||
| VALUES(@Date, @Score)"; | ||
| } | ||
| internal static string ViewHistory() | ||
| { | ||
| return "SELECT * FROM History"; | ||
| } |
There was a problem hiding this comment.
🟠 Methods?
❓ Why are these methods? Ideally these are constant string values so should be treated as such.
| internal static string AddToHistory() | |
| { | |
| return @"INSERT INTO History(Date, Score) | |
| VALUES(@Date, @Score)"; | |
| } | |
| internal static string ViewHistory() | |
| { | |
| return "SELECT * FROM History"; | |
| } | |
| internal const string AddToHistory = @"INSERT INTO History(Date, Score) | |
| VALUES(@Date, @Score)"; | |
| internal const string ViewHistory = "SELECT * FROM History"; |
| internal class SqlHelper | ||
| { | ||
|
|
||
| internal static string CreateStackTable() |
There was a problem hiding this comment.
🟠 Should be Constants
| { | ||
| internal class SQL_History | ||
| { | ||
| internal static string AddToHistory() |
There was a problem hiding this comment.
🟠 Naming
💡 The name of this makes it seem like it does something. Really this is the AddToHistoryCommandText.
| internal class SqlHelper | ||
| { | ||
|
|
||
| internal static string CreateStackTable() |
There was a problem hiding this comment.
🟠 Should have better names
|
I want to thank you for your quick response, and very very detailed review! I appreciate all the warnings and oddities included. I have received reviews from you on 2 separate projects now, and have learned alot of good info because of them! I hope this submission meets the academy standards! |

No description provided.