Table of Contents

Dependency viewer

The Dependency Viewer is a powerful tool in Neos Studio that helps you analyze and understand the dependencies between various elements in your Neos cluster. It provides a visual tree representation of how different elements relate to each other by scanning both metadata dependencies and code references (server-side business assemblies and C# code within metadata). This comprehensive analysis is essential for understanding the impact of changes and maintaining clean architecture.

Accessing the dependency viewer

You can access the Dependency Viewer from the Neos Studio main navigation:

  1. Open Neos Studio in your browser
  2. In the left navigation panel, expand the Tools section
  3. Click on Dependency Viewer

Quick access to "Display all references to a specific item"

The "Display all references to a specific item" mode can also be accessed directly through several convenient shortcuts:

  • From main application screens: Click the More button and select "Find all static references"
  • Keyboard shortcut: Press Shift+F12 while an element is selected
  • From Neos Studio explorer: Click the "Find all static references" button on any element displayed in the explorer

These shortcuts will automatically open the Dependency Viewer with the selected element and mode pre-configured.

What is analyzed

The Dependency Viewer performs a comprehensive analysis across your entire Neos cluster by examining:

Metadata dependencies

  • YAML metadata files (entities, UI views, interfaces, etc.)
  • Cross-references between metadata elements
  • Module dependencies and relationships

Code dependencies

  • Server-side code: C# files in your business assemblies
  • Client-side code: C# code embedded within metadata files

Server code analysis details

The server code search uses regular expressions to find type references. For the dependency analysis to work correctly, the search requires either:

  1. Full namespace path: The complete namespace and type name (e.g., MyProject.Domain.Entities.Customer)
  2. Using statement + type name: The namespace included in the file's using statements and the type name present in the code

Important considerations:

  • Partial namespaces: Using partial namespaces in your code will prevent the dependency search tool from finding references correctly
  • Resource strings exception: The only exception is for resource string searches, where the regex is optimized to find the pattern (Resources|AppResources|UIResources).ModuleName.ResourceName
  • Accessibility processing limitation: The accessibility change processing is type-based and will not work for resources referenced with partial namespaces

This multi-layered analysis ensures you get a complete picture of how changes to any element might impact other parts of your application, whether they are defined in metadata or implemented in code.

Understanding the interface

The Dependency Viewer interface is split into two main panels:

Left panel - Dependency tree

The left panel contains the configuration options and dependency tree:

  • Mode: Choose between different dependency analysis modes:

    • Display all references to a specific item: Shows what elements use the selected element
    • Show all references for items of a given type: Shows all references for all items of the selected type
    • Show defined but unused items: Identifies elements that are defined but not referenced anywhere
    • Accessibility change suggestions: Provides recommendations for accessibility changes
  • Entity Type: Select the type of element you want to analyze (Entity, Interface, UI view, etc.)

    • For "Show defined but unused items" mode: This field is optional - leave empty to search across all element types, or select a specific type to filter results
    • For other modes: This field is required to specify the type of elements to analyze
  • Element Name: Specify the name of the element to analyze (only available when using "Display all references to a specific item" mode)

  • Load Button: Click to generate the dependency tree based on your selections

  • Dependency Tree: A hierarchical view showing the relationships between elements

    • Each node shows an element with its appropriate icon
    • Expandable nodes show nested dependencies
    • Nodes may display warning or information messages about accessibility issues
    • Manual References Button: Available on dependency nodes to manage manually defined references when additional documentation or external references need to be tracked

Right panel - File preview

The right panel shows detailed information about the selected dependency:

  • Accessibility Layers: Displays which architectural layers (Domain, Application, Frontend) can access the selected element
  • File Selector: Choose from the available files related to the selected dependency
  • Code Preview: Shows the actual YAML or C# code content of the selected file in a read-only editor with syntax highlighting

Using the dependency viewer

Analyzing element usage

To see what elements use a specific element:

  1. Set Mode to "Display all references to a specific item"
  2. Select the appropriate Entity Type from the dropdown
  3. Enter the Element Name you want to analyze
  4. Click Load to generate the dependency tree
  5. Expand nodes in the tree to explore the relationships
  6. Click on any node to view its details in the right panel

Analyzing references by type

To see all references for items of a given type:

  1. Set Mode to "Show all references for items of a given type"
  2. Select the appropriate Entity Type from the dropdown
  3. Click Load to generate the dependency tree showing all items of that type and their references
  4. Explore the tree to understand how items of this type are used

Finding unused elements

To identify elements that are defined but not used:

  1. Set Mode to "Show defined but unused items"
  2. Optional: Select a specific Entity Type from the dropdown to filter by type, or leave empty to search across all element types
  3. Click Load to generate a list of unused elements
  4. Review the list to identify candidates for cleanup or refactoring

Note: When no entity type is specified in unused elements mode, the tool will search across all supported element types, providing a comprehensive view of unused elements throughout your cluster.

Getting accessibility suggestions

To get recommendations for accessibility improvements:

  1. Set Mode to "Accessibility change suggestions"
  2. Select the appropriate Entity Type from the dropdown
  3. Click Load to see suggested accessibility changes
  4. Review the suggestions to improve your architecture

Important: Accessibility change suggestions for elements referenced by unanalyzed code (e.g., external C# files not included in the Neos dependency analysis) may be incorrect and could lead to invalid code. If you encounter this situation, it is recommended to manually add a reference to the element to indicate this external usage. No accessibility change suggestions will be proposed for elements that have at least one manually defined reference.

Understanding accessibility messages

The Dependency Viewer shows accessibility information through colored chips and messages:

  • Domain: Elements accessible from the domain layer
  • Application: Elements accessible from the application layer
  • Frontend: Elements accessible from the frontend layer

Messages may indicate:

  • Information: Helpful guidance about accessibility
  • Warning: Potential issues with current accessibility settings
  • Error: Accessibility violations that need attention

Managing manual references

For elements that have dependencies not automatically detected by the analysis engine (such as external system integrations or special use cases), you can manually define references:

  1. Access manual references: Click the "Manage manual references" button available in the right panel
  2. Add internal references:
    • Select Internal reference checkbox
    • Choose the Entity Type from the dropdown
    • Enter the Element Name
    • Optionally add a Description to document the relationship
  3. Add external references:
    • Leave Internal reference unchecked
    • Enter a descriptive text in the Description field (e.g., "Used by mobile application", "Referenced in external documentation")
  4. Save changes: Click Save to persist the manual references

Manual references are particularly useful for:

  • Documenting usage by external systems
  • Tracking references in non-code contexts (documentation, configuration files)
  • Ensuring critical dependencies are not missed during impact analysis
  • Providing additional context for dependency relationships

Use cases

Impact analysis

Before making changes to an element, use the Dependency Viewer to understand:

  • Which other elements might be affected by your changes (both in metadata and code)
  • How widely used an element is across your cluster
  • Whether it's safe to modify or delete an element
  • Impact on both business assembly C# code and C# code embedded in metadata
  • External dependencies documented through manual references that might not be automatically detected

Architecture validation

Use the Dependency Viewer to:

  • Verify that your module dependencies follow clean architecture principles
  • Identify circular dependencies that should be avoided
  • Ensure proper layer separation in your application

Refactoring support

When refactoring code:

  • Identify all usages of an element before renaming or moving it (in both metadata and business assembly code)
  • Understand the scope of changes needed when modifying interfaces or entities
  • Plan refactoring steps to minimize breaking changes across metadata and business assembly implementation
  • Use the unused elements mode to identify code that can be safely removed

Code cleanup

For maintaining clean code:

  • Use the "Show defined but unused items" mode to identify dead code in both metadata and business assemblies
    • Search across all element types by leaving the Entity Type field empty for a comprehensive cleanup analysis
    • Or focus on specific element types to perform targeted cleanup
  • Review unused elements before removing them to ensure they're truly not needed
  • Clean up obsolete elements that are no longer referenced in any metadata or business assembly files
  • Use manual references to document elements that appear unused but are actually required by external systems

Code review

During code reviews:

  • Verify that new dependencies follow established patterns
  • Check that accessibility levels are appropriate for the intended usage
  • Ensure that new elements don't create unwanted coupling
  • Use accessibility suggestions to improve architectural decisions