TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: I made a tool to build a map of your code

1 点作者 zknill超过 2 年前

2 条评论

zknill超过 2 年前
Hi, I’m Zak. I built <a href="https:&#x2F;&#x2F;packagemap.co" rel="nofollow">https:&#x2F;&#x2F;packagemap.co</a> to see how cohesive&#x2F;coupled code was.<p>I do a bunch of code review, particularly in github. The code review UI is great, but I found that I was only reviewing the content of the files. I was missing how those files fit together. I found it hard to see from a file-tree, in an IDE or in Github code review, how the types are used across an application.<p>As the applications I reviewed got larger, I wanted to check if the code was being packaged by domain — to be cohesive. I wanted to check that the code that is related to each other is in the same package, and that there were few cross-package imports.<p>To solve the problems I had with code review, and to see how code fits together, I built <a href="https:&#x2F;&#x2F;packagemap.co" rel="nofollow">https:&#x2F;&#x2F;packagemap.co</a>. Packagemap is made of two parts. The first part is a java parser (hopefully other languages to come) that builds an AST of your code, to work out which classes are using which other classes. The parser runs on your machine, so the source files stay on your machine. The second part is the <a href="https:&#x2F;&#x2F;packagemap.co" rel="nofollow">https:&#x2F;&#x2F;packagemap.co</a> site. On the site you can filter and explore the “maps” (directed graphs of the code’s imports).<p>You can filter and explore maps by prefix, like “com.example.package” or by wildcard “*.package.MyClass”<p>You can play with the example here: <a href="https:&#x2F;&#x2F;packagemap.co&#x2F;map&#x2F;f8bbec2a-d7e7-459e-b08e-ea813bb0deb5" rel="nofollow">https:&#x2F;&#x2F;packagemap.co&#x2F;map&#x2F;f8bbec2a-d7e7-459e-b08e-ea813bb0de...</a>
Qtips87超过 2 年前
There is a tool that do something similar but I think it is a desktop app.<p><a href="https:&#x2F;&#x2F;www.ndepend.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ndepend.com&#x2F;</a>