-
Notifications
You must be signed in to change notification settings - Fork 0
Weekly Code Quality Check & Fix #6
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Code Quality Report - Weekly Check | ||
|
|
||
| ## 1. Error Detection & Resolution | ||
| - **Java Version Mismatch**: Fixed three Maven projects (`AppDelPorcoDio`, `EsercitazioneVerifica`, `AuradelPorDios`) that were targeting Java 25, which is not supported in the current environment (JDK 21). Updated `pom.xml` files to target Java 21. | ||
| - **Syntax Fixes**: Resolved syntax errors in `if` statements introduced during string comparison refactoring. | ||
| - **Project Compilation**: All projects in the repository now compile successfully. | ||
|
|
||
| ## 2. Warning Analysis & Cleanup | ||
| - **Compilation Warnings**: No significant warnings (e.g., unused imports) were reported in the final build logs after the fixes. | ||
|
|
||
| ## 3. Code Quality Improvements | ||
| - **Null-Safety**: Refactored all instances of `variable.equals("literal")` to `"literal".equals(variable)` to prevent potential `NullPointerException`s. | ||
| - **Resource Management**: Verified that Maven projects use standard resource directories where applicable. | ||
| - **Exception Handling**: Added a clarifying comment to an intentional empty catch block in `ImpiccatoController.java` to document why it is being ignored. | ||
| - **String Literals**: Extracted the repeated string literal `"Input Error"` into a `private static final String` constant in `ConvertitoreController.java`. | ||
|
|
||
| ## 4. Best Practices Enforcement | ||
| - **Naming Conventions**: Verified that most projects follow standard Java naming conventions. | ||
| - **Annotations**: Confirmed that standard method overrides (e.g., `toString`, `equals`) have the `@Override` annotation. | ||
| - **Maven Configuration**: Standardized Maven projects to use stable versions of dependencies and the correct compiler target. | ||
|
|
||
| ## 5. Security & Performance | ||
| - **Input Validation**: Verified basic input validation in UI controllers (e.g., `ConvertitoreController`). | ||
| - **Standardized Environment**: Ensuring all projects use JDK 21 improves build predictability and performance. | ||
|
|
||
| ## 6. Metrics Summary | ||
| - **Errors Fixed**: 6 | ||
| - **Warnings Resolved**: 0 (No warnings remaining) | ||
| - **Refactored Files**: 10 | ||
| - **Build Status**: 100% Success | ||
|
|
||
| ## 7. Recommendations | ||
| - Maintain the use of JDK 21 across all new projects to avoid version mismatches. | ||
| - Continue the practice of null-safe string comparisons. | ||
| - Consider migrating standalone tutorial files in `Laboratorio/JavaFX/JavaFX_Tutorial/` to a structured Maven project if they need to be part of the automated build process. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,6 +124,7 @@ private void aggiornaVistaMaghi() { | |
| Image img = new Image(getClass().getResourceAsStream("/com/example/torneodeimaghi/imagess/" + mago.getSpritePath())); | ||
| imgView.setImage(img); | ||
| } catch (Exception e) { | ||
| e.printStackTrace(); | ||
| System.out.println("Immagine non trovata: " + mago.getSpritePath()); | ||
|
Comment on lines
126
to
128
|
||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,7 @@ public Cd(String titolo, String autore, int numBrani, double durata) { | |||||
| } | ||||||
|
|
||||||
| // metodi | ||||||
| @Override | ||||||
|
||||||
| @Override | |
| @Override |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -71,7 +71,7 @@ public int confrontaCollezione(PortaCD altra) { | |||||
| } | ||||||
| return matches; | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
|
||||||
| @Override | |
| @Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Overrideis not indented consistently with the rest of the class. Please align it with the method indentation to match the repo’s common style (e.g.,Laboratorio/Biblioteca/src/Libro.java:33).