Stale code comments, and README gaps on promotion, undo and keyboard play

Open Beginner friendly
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript

Research direction

Read the listed comments in js/game.js, js/utils.js, js/config.js and js/main.js, then compare them with the referenced code and README sections. Update or remove each stale comment and document queen-only promotion, Undo and keyboard controls in README.md under the indicated sections. Run npm test and npm run lint; done when every listed item is corrected.

Written by the indexing model from the issue text.

Description

documentation good first issue severity: low

Summary

Several comments contradict the code, and the README does not tell players about two limits of the current build.

Where

  • js/game.js:15: "For undo and repetition detection". No repetition detection exists.
  • js/game.js:667-668, :696-698: "Using plain objects here" and "If Piece was a class". Piece is a constructor (js/pieces.js:22) and promotion calls new Piece(...).
  • js/game.js:796-811: generateNotation carries a disambiguation TODO, but live notation comes from generateNotationWithDisambiguation.
  • js/utils.js:221-223: "Add more utility functions as needed, e.g. Deep cloning". deepClone is already at :60.
  • js/utils.js:176-177: "Will be used when sound effects feature is enabled". It is already called from game.js.
  • js/config.js:10: "Feature flags (for future enhancements)" sits above DRAG_AND_DROP: true.
  • js/main.js:83-85: "initializes the skeleton implementations". Drag and drop is the only module started, and it is complete.
  • README.md:72: lists pawn promotion with no note that it always promotes to a queen (js/game.js:223).
  • README.md:150-165: "How to Play" omits the Undo button and the keyboard controls.

Suggested fix

Fix or remove each comment. Add to the README: promotion is always to a queen, an Undo and keyboard-controls line in "How to Play".

Acceptance criteria

  • Each item above is corrected

Getting started

  • Relevant files: js/game.js, js/utils.js, js/config.js, js/main.js, README.md
  • How to run tests: npm install, then npm test and npm run lint
  • Related docs: docs/ARCHITECTURE.md, .github/CONTRIBUTING.md

Filed by repo-audit/full-audit at 8a2c86c. Severity: low. Effort: S. audit-key: documentation|js/game.js|stale-comments

Dominant language
JavaScript
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TMHSDigital/Static_Chess

All issues in TMHSDigital/Static_Chess

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.