Skip to content

Weekly Code Quality Check & Fix#6

Open
bigBrodyG wants to merge 1 commit into
mainfrom
code-quality-fix-weekly-7874247859864325010
Open

Weekly Code Quality Check & Fix#6
bigBrodyG wants to merge 1 commit into
mainfrom
code-quality-fix-weekly-7874247859864325010

Conversation

@bigBrodyG
Copy link
Copy Markdown
Owner

This PR performs a comprehensive analysis and fix of code quality issues across the repository.
Highlights:

  1. Resolved build failures in multiple Maven projects by downgrading Java target from 25 to 21 (consistent with environment).
  2. Improved null-safety by refactoring string comparisons.
  3. Enhanced maintainability by extracting repeated literals and adding proper annotations.
  4. Added documentation to catch blocks and created a full quality report.
    All projects now compile successfully.

PR created automatically by Jules for task 7874247859864325010 started by @bigBrodyG

- Fixed Java version mismatch in Maven projects (targeted JDK 21).
- Refactored string comparisons to use null-safe "literal".equals(var) pattern.
- Extracted repeated string literals into private static final constants.
- Added @OverRide annotations to standard method overrides.
- Documented intentional empty catch blocks.
- Generated comprehensive CODE_QUALITY_REPORT.md.

Co-authored-by: bigBrodyG <152636135+bigBrodyG@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings April 16, 2026 22:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies a repo-wide “code quality” pass focused on build compatibility (JDK 21), safer string comparisons, small maintainability improvements, and added documentation/reporting.

Changes:

  • Downgraded Maven compiler source/target from 25 to 21 in affected JavaFX Maven projects.
  • Refactored several string comparisons to the null-safe "literal".equals(variable) pattern.
  • Added small maintainability improvements (e.g., extracted "Input Error" constant, added @Override annotations, documented an intentionally ignored catch) and introduced a weekly quality report.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Laboratorio/Playlist/src/Main.java Null-safe string comparisons when branching on artist name.
Laboratorio/OggettoCD/src/PortaCD.java Added @Override for toString().
Laboratorio/OggettoCD/src/Cd.java Added @Override for toString().
Laboratorio/JavaFX/TorneoDeiMaghi/src/main/java/com/example/torneodeimaghi/Wizard.java Null-safe string comparisons for spell type dispatch.
Laboratorio/JavaFX/TorneoDeiMaghi/src/main/java/com/example/torneodeimaghi/HelloController.java Added stack trace output in image-load failure handling.
Laboratorio/JavaFX/Impicciato/src/main/java/com/example/impicciato/ImpiccatoController.java Documented intentionally ignored exception in image loading.
Laboratorio/JavaFX/EsercitazioneVerifica/pom.xml Maven compiler target updated to Java 21.
Laboratorio/JavaFX/Calcolatrice/src/main/java/Calcolatrice.java Null-safe string comparisons in display/operator logic.
Laboratorio/JavaFX/AuradelPorDios/src/main/java/aura/auradelpordios/ArenaController.java Null-safe string comparison for wizard name in special mode.
Laboratorio/JavaFX/AuradelPorDios/pom.xml Maven compiler target updated to Java 21.
Laboratorio/JavaFX/AppDelPorcoDio/src/main/java/aura/appdelporcodio/HelloController.java Null-safe credential string comparisons.
Laboratorio/JavaFX/AppDelPorcoDio/pom.xml Maven compiler target updated to Java 21.
Esercizi/GestionePC/src/InventarioPC.java Added @Override for toString().
ConvertitoreXML/src/main/java/com/example/convertitorexml/ConvertitoreController.java Extracted repeated "Input Error" into a constant.
CODE_QUALITY_REPORT.md Added a weekly code quality report summarizing the changes.

return matches;
}

@Override
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

@Override is not indented like the rest of the class members/methods in this file. Align it with the method indentation (consistent with other @Override usages across the repo) to keep formatting consistent and avoid noisy diffs in future auto-formatting.

Suggested change
@Override
@Override

Copilot uses AI. Check for mistakes.
}

// metodi
@Override
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

@Override is flush-left while the method is indented. Indent the annotation to match the surrounding method indentation for consistent formatting.

Suggested change
@Override
@Override

Copilot uses AI. Check for mistakes.
return pcs.size();
}

@Override
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

@Override is 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).

Suggested change
@Override
@Override

Copilot uses AI. Check for mistakes.
Comment on lines 126 to 128
} catch (Exception e) {
e.printStackTrace();
System.out.println("Immagine non trovata: " + mago.getSpritePath());
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

Calling printStackTrace() here will spam stderr for an expected/handled scenario (missing image resource), and it relies on exceptions for control flow. Prefer explicitly checking whether getResourceAsStream(...) returned null and logging a concise message (or using a logger) instead of printing a full stack trace.

Copilot uses AI. Check for mistakes.
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.

2 participants