Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Dependency Visualizer with Multi-Level Views and Code Quality Insights #45

Open
florianbgt opened this issue Dec 2, 2024 · 1 comment
Assignees
Labels
code insight help wanted Extra attention is needed

Comments

@florianbgt
Copy link
Member

florianbgt commented Dec 2, 2024

Description

The goal of this story is to design a UX/UI for the Dependency Visualizer tool.
This tool will provide an intuitive interface to explore dependencies across folder, file, and code levels while highlighting potential code quality issues.
The design should prioritize easy navigation, filtering, and actionable insights to improve code understanding and maintainability.

Sidebar

Hierarchical Display

  • Display folders at the top level.
  • Show files within folders and methods/functions/classes within files in an expandable hierarchy.

Navigation

When clicking on an element, navigate to the right view:

  • clicking on a folder goes to the Folder Level Dependencies View
  • clicking on a file goes to the File-Level Dependencies View
  • clicking on a class, function goes to the Code-Level View

Filter/Search

  • Add a filter/search bar at the top. Works with a REGEX to filter:
    • folder
    • files
    • function, classes, variables.
  • Allow dynamic updates to the view based on the search.

Main views

Folder Level Dependencies View

AI generated conceptual view
Image

  • Display a tree structure to show interactions between folders
  • Indicate too many interdependencies visually (yellow)
  • Indicate circular dependency visually (red)

File-Level Dependencies View

Extracted from structure 101 documentation
image

A simpler representation of what we need
Image

Once a file is clicked (from the side bar or the Folder-level dependency view, this view is shown.

Enhanced Dependency view

  • Show all the exports the selected file has (variable, functions, classes)
  • For each export, show which import they use from other files.
  • For each export, show what other file are using them.

Code quality

  • Use a global score for each export and a color (green, orange, red)
  • Mark unused export in gray
  • Mark too many interdependencies visually (yellow)
  • Mark circular dependencies (red)

Code-Level View

This view is triggered when a user click on a class or a function.

Function Metrics

Highlight functions with metrics like:

  • Number of imports used by the function
  • Function length (indicating overly long methods).
  • Cyclomatic complexity (too many branching paths).

Variable Metrics

No view for this.

Class Metrics

Break down files into their constituent classes, methods, or functions, displayed as a nested hierarchy.

  • Highlight unused sub classes, methods or function in gray
  • For function show the same as for the function view (in a nested way)
@florianbgt florianbgt converted this from a draft issue Dec 2, 2024
@florianbgt
Copy link
Member Author

https://structure101.com/help/cpa/studio6/#intro/getting-started-studio.html?TocPath=Studio%257C_____1

We tool a lot of inspiration from this tool (strcture101) when designing this document

@florianbgt florianbgt added the help wanted Extra attention is needed label Dec 13, 2024
@florianbgt florianbgt moved this from TODO to In Progress in napi development Dec 17, 2024
@florianbgt florianbgt self-assigned this Dec 17, 2024
@florianbgt florianbgt mentioned this issue Jan 15, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code insight help wanted Extra attention is needed
Projects
Status: In Progress
Development

No branches or pull requests

1 participant