landscape-graph icon indicating copy to clipboard operation
landscape-graph copied to clipboard

Fix: resolve code quality issues and minor bugs

Open shbhmexe opened this issue 5 months ago • 0 comments

Description: This PR addresses several easy to medium-level code quality issues identified during a repository audit.

Changes:

  1. util/landgraph/landgraph.js:

    • Fixed a typo in the out option definition: typelabel -> typeLabel. This ensures the help text displays correctly.
    • Fixed a logic error in the help condition. Previously if (options.help || options) was always true. Changed to if (options.help || Object.keys(options).length === 0) to correctly show help only when requested or no options are provided.
  2. generate-entities.sh:

    • Added a missing comma after the description field in the JMESPath query. This fixes a syntax error in the JSON projection.
  3. cleanup.sh:

    • Updated the find and xargs command to use -print0 and -0 respectively. This handles filenames with spaces or special characters correctly.
    • Removed the non-portable -d flag from find.
    • Removed the unnecessary {} placeholder from xargs.

Impact: These changes improve the correctness, stability, and portability of the codebase. No existing functionality is altered or broken.

Verification:

  • Verified syntax for all modified scripts.
  • Confirmed landgraph.js help logic now works as expected.
  • Confirmed generate-entities.sh query syntax is valid.
  • Confirmed cleanup.sh command is syntactically correct and portable.

Checklist:

  • [x] Changes do not break any existing functionality
  • [x] Commit message follows DCO sign-off
  • [x] Branch name follows conventions

shbhmexe avatar Nov 26 '25 11:11 shbhmexe