[Canonical page](<https://docs.dhtmlx.com/planning-engine/net/api/project-analyze/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# Project.Analyze

Computes analytics over dates without scheduling them. It reads either a supplied [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/project-data.md>) or the current dates of a [`Project`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/project.md>), including unsolved edits. It never installs data and never changes the solved status.

## Signature

```csharp
public ScheduleResult Analyze(ProjectData? data, AnalyzeOptions options)
```

Synchronous and CPU-only. Doesn't change the project's state, and works on an unsolved project.

## Parameters

| Name | Type | Description |
|---|---|---|
| `data` | [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/net/api/core/data/project-data.md>)`?` | Dates to analyze, or `null` for the project's current dates |
| `options` | [`AnalyzeOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/analyze-options.md>) | Which analytics to compute |

## Behavior

- A non-null `data` is validated and analyzed as given, but never installed. With [`Validation.Repair`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/validation.md>), repairs run on a copy and leave the caller's object unchanged. Each repair appears as a [`Note.Repaired`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/note.md#repaired>).
- `null` analyzes the project's current dates, including edits made by [`Apply`](<https://docs.dhtmlx.com/planning-engine/net/api/project-apply.md>) since the last solve.

## Returns

A [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) with `Cycles`, `Notes`, [`Analytics`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/analytics.md>) and `Overallocations` filled. `Updates` and `Conflicts` are empty. `BaselineId` is set only when `data` is `null` and the project is solved with no unsolved edits.

## Errors

| Error | When |
|---|---|
| [`InputException`](<https://docs.dhtmlx.com/planning-engine/net/api/core/errors/input-exception.md>) | Supplied `data` fails validation |
| `ArgumentNullException` | `options` is `null` |

## Example

Get the critical path of dates stored elsewhere, without scheduling them.

```csharp
using Plen;

Moment Day(int d) => Moment.FromYmdHm(2026, 1, d, 0, 0) ?? throw new InvalidOperationException("invalid date");

var data = new ProjectData
{
    Tasks =
    [
        new TaskData("design") { StartDate = Day(5), Duration = 2.0 },
        new TaskData("build") { StartDate = Day(7), Duration = 3.0 },
    ],
    Links = [new LinkData { Id = "l1", Source = "design", Target = "build" }],
};

var project = new Project();
var options = new AnalyzeOptions
{
    Analytics = new AnalyticsOptions { CriticalPath = true },
};
var result = project.Analyze(data, options);

if (result.Analytics?.CriticalPath is { } critical)
    Console.WriteLine($"critical tasks: {string.Join(", ", critical.Tasks)}");
```

## Related

- [`AnalyzeOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/analyze-options.md>) - the options
- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) - the returned result
- [`Analytics`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/analytics.md>) - the critical path and slack data
- [Critical path and slack](<https://docs.dhtmlx.com/planning-engine/net/scheduling/critical-path-and-slack.md>) - requesting and reading analytics
