[Canonical page](<https://docs.dhtmlx.com/planning-engine/java/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/java/api/data/project-data.md>) or the current dates of a [`Project`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project.md>), including unsolved edits. It never installs data and never changes the solved status. Works on an unsolved project.

## Signature

```java
public ScheduleResult analyze(ProjectData data, AnalyzeOptions options)
```

Synchronous and CPU-only. Doesn't change the project's state. Not synchronized: serialize calls on one instance.

## Parameters

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

## Behavior

- A non-null `data` is validated and read as is. The method doesn't install it or modify the caller's object. [`ProjectOptions.validation`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project-options.md>) decides whether invalid data is rejected or repaired. With `Validation.REPAIR`, the repairs apply to a copy and appear in `notes` as `Note.Repaired`.
- `null` reads the project's current dates, including edits from [`apply`](<https://docs.dhtmlx.com/planning-engine/java/api/project-apply.md>) that no `solve` has scheduled yet.

## Returns

A [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) with `cycles`, `notes`, `analytics` and `overallocations`. Its `updates` and `conflicts` are empty, `converged` is `true` and `profile` is `null`. Its `baselineId` is set only for `null` `data` on a solved project with no unsolved edits.

## Errors

All exceptions are unchecked.

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

## Example

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

```java
import java.util.List;
import org.dhtmlx.plen.*;

public class AnalyzeExample {
  public static void main(String[] args) throws Exception {
    ProjectData data = new ProjectData()
        .withTasks(List.of(
            new TaskData(Id.str("design"))
                .withStartDate(Moment.fromYmdHm(2026, 1, 5, 8, 0))
                .withDuration(2.0),
            new TaskData(Id.str("build"))
                .withStartDate(Moment.fromYmdHm(2026, 1, 7, 8, 0))
                .withDuration(3.0)))
        .withLinks(List.of(new LinkData()
            .withId(Id.str("l1"))
            .withSource(Id.str("design"))
            .withTarget(Id.str("build"))));

    Project project = new Project();
    AnalyzeOptions options = new AnalyzeOptions()
        .withAnalytics(new AnalyticsOptions().withCriticalPath(true));
    ScheduleResult result = project.analyze(data, options);

    if (result.analytics != null && result.analytics.criticalPath != null) {
      System.out.println("critical tasks: " + result.analytics.criticalPath.tasks);
    }
  }
}
```

## Related

- [`AnalyzeOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/project/analyze-options.md>) - which analytics to compute
- [`Analytics`](<https://docs.dhtmlx.com/planning-engine/java/api/results/analytics.md>) - the slack and critical path in the result
- [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/java/api/results/schedule-result.md>) - the result type, with empty updates
- [Analyzing without scheduling](<https://docs.dhtmlx.com/planning-engine/java/scheduling/critical-path-and-slack.md#analyzing-without-scheduling>) - analytics over dates you supply
- [Reading results](<https://docs.dhtmlx.com/planning-engine/java/scheduling/reading-results.md>) - cycles, notes and overallocations in a result
