> For the complete documentation index, see [llms.txt](https://docs.walnutai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.walnutai.ai/core-features/gap-analysis/phase-1-missing-code-detection.md).

# Phase 1: Missing Code Detection

**Phase 1:** Missing Code Detection validates whether documented requirements are implemented in the connected code repository. In this phase, User Stories act as the baseline, and WalnutAI verifies whether corresponding functionality exists in the selected code branches.

* Before starting the analysis:
  * The project must contain **User Stories** in the Action Items.
  * Ensure all required stories are created and available, these stories will be used as the reference for comparison against the codebase.
* To start the analysis:

  * Click **Start Analysis**.

  <figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F6zKrP5c2n9qjqXvsa2QQ%2Fimage.png?alt=media&amp;token=46d72b03-8327-47bb-94a7-891b05ba74a3" alt=""><figcaption></figcaption></figure>

  * Select one or more **connected repositories** (repositories that were linked during project creation).

  <figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FBBlQKCNqdAhZuSJMOnPI%2Fimage.png?alt=media&amp;token=cdf074c3-7ff5-4243-a5b3-efadd30d3e12" alt=""><figcaption></figcaption></figure>

  * Click "**Start Analysing"** to begin evaluation and start Analysing.

  <figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FcEO0jaxoR2lZoV0g6qHp%2Fimage.png?alt=media&amp;token=8f7f5402-1879-4758-a8c6-ba3019dfe441" alt=""><figcaption></figcaption></figure>
* During analysis:
  * WalnutAI compares each user story with the selected repository branches.
  * It checks whether the requirement is fully implemented.
  * It detects partially implemented functionality.
  * It identifies requirements that are not implemented at all.
* After the analysis completes, the **Analysis Summary** section displays:

  * **Stories Analysed** – Total number of user stories evaluated.
  * **Gaps Found** – Total number of gaps identified.
  * **Coverage %** – Overall implementation coverage based on analysis.
  * A breakdown of **Missing**, **Incomplete**, and **Outdated** counts.

  <figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2Flc0zoxitxxvnKZqQOJFN%2Fimage.png?alt=media&amp;token=12d9e746-1fe9-4c93-a7d1-dc2b4732c6c4" alt=""><figcaption></figcaption></figure>

  <figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F4lJ68xzhiICcedawL53C%2Fimage.png?alt=media&amp;token=1aed3207-66dc-493e-bafb-137fd4a2eaf3" alt=""><figcaption></figcaption></figure>
* When a user clicks on a specific user story, the **AI Recommendations** panel displays suggestions such as:
  * Implementation suggestions
  * Displays estimated effort (if available).
  * Highlights missing elements.
  * Shows related code references with match percentage.
  * Recommends an approach to close the identified gap.
* The **Confidence Score** indicates how strongly the implementation aligns with the requirement based on WalnutAI’s semantic comparison.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FPGoIH8rzFt8oAMav8GFG%2Fimage.png?alt=media&amp;token=b37de370-7cf7-4beb-90d7-b67b5d5f6214" alt=""><figcaption></figcaption></figure>

* Click **Run New Analysis** to re-evaluate the selected user stories against the latest code changes and update the analysis results accordingly

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FQ87v4qexyHSLTi0MTQ5V%2Fimage.png?alt=media&amp;token=eedbcba0-6daf-486c-8f88-e329107c8f54" alt=""><figcaption></figcaption></figure>

Phase 1 ensures every user story is validated against the codebase, clearly identifies missing or incomplete implementations, maintains requirement-to-code traceability, and enables teams to proactively resolve gaps before release.
