{"id":13831958,"url":"https://github.com/multilang-depends/depends","last_synced_at":"2025-07-09T15:34:21.254Z","repository":{"id":38416772,"uuid":"169956182","full_name":"multilang-depends/depends","owner":"multilang-depends","description":"Depends is a fast, comprehensive code dependency analysis tool","archived":false,"fork":false,"pushed_at":"2025-02-12T22:54:16.000Z","size":31736,"stargazers_count":210,"open_issues_count":12,"forks_count":56,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-02-12T23:30:31.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multilang-depends.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-10T08:08:28.000Z","updated_at":"2025-02-12T22:47:42.000Z","dependencies_parsed_at":"2024-01-07T12:22:09.809Z","dependency_job_id":"7dfeb16f-edb7-4ff1-afd7-1bcb659caa53","html_url":"https://github.com/multilang-depends/depends","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/multilang-depends/depends","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multilang-depends%2Fdepends","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multilang-depends%2Fdepends/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multilang-depends%2Fdepends/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multilang-depends%2Fdepends/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multilang-depends","download_url":"https://codeload.github.com/multilang-depends/depends/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multilang-depends%2Fdepends/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264486300,"owners_count":23616014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T10:01:45.597Z","updated_at":"2025-07-09T15:34:16.158Z","avatar_url":"https://github.com/multilang-depends.png","language":"Java","funding_links":[],"categories":["Java","Multiple languages"],"sub_categories":[],"readme":"# Introduction\n\n*Depends* is a source code dependency extraction tool, designed to infer syntactical relations among source code entities, such as files and methods, from various programming languages. Our objective is to provide a framework that is easily extensible to support dependency extraction from different programming languages and configuration files, so that other high-level analysis tools can be built upon it, in a language-independent fashion. Sample applications include code visualization, program comprehension, code smell detection, architecture analysis, design refactoring, etc.  \n\nOur creation of *Depends* is motivated by the observations that different vendors, such as Understand\u0026trade;, Structure 101 \u0026trade;, and Lattix\u0026trade;, created their own dependency extraction tools that are packaged with their other analysis functions. To conduct new analysis, vendors and researchers must each create their own dependency extraction tools, or use the output of other tools, which are usually not designed to be reusable. \n\nWe believe that dependency analysis of software source code is one of the most important foundations of software engineering. Given the growing number of systems built on new languages and multi-languages, the need of a flexible, extensible multi-language dependency extraction framework, with simple and unified interfaces is widely recognized. \n\n*Depends* is open source and free, to promote community collaboration, to avoid repetitive work, and to improve the quality of analytical tools.\n\n# How to use *Depends*\n\n## Download and installation\n\nYou could download the latest version of *Depends* from https://github.com/multilang-depends/depends/releases/,  \nand then unzip the ```depends-*version*.tgz``` file in any directory of your computer.\n\n*Depends* is written in java, so it could be run on any OS with a JRE or JDK environment (like Windows, Linux or Mac OS). \n\n## Run it from command line\n\nFollowing the single responsibility principle, *Depends* is designed for the purpose of extracting dependencies only. It only provides CLI interface, without GUI. But you can convert the output of *Depends* into the GUI of other tools, such as GraphViz(http://graphviz.org/), PlantUML(http://plantuml.com/), and DV8 (https://www.archdia.com). \n\nYou could run *Depends* in the following ways: ```depends.sh``` on Linux/Mac, ```depends.bat``` on Microsoft Windows, or  ```java -jar depends.jar```.\n\nNote: If you encountered Out of Memory error like ```GC overhead limt exceed```, please expand\nthe JVM memory like following ```java -Xmx4g -jar depends.jar \u003cargs\u003e```.\n\n## Parameters\n\nThe CLI tool usage could be listed by ```depends --help```, like following:\n\n    Usage: depends [-hms] [--auto-include] [-d=\u003cdir\u003e] [-g=\u003cgranularity\u003e]\n                   [-p=\u003cnamePathPattern\u003e] [-f=\u003cformat\u003e[,\u003cformat\u003e...]]...\n                   [-i=\u003cincludes\u003e[,\u003cincludes\u003e...]]... \u003clang\u003e \u003csrc\u003e \u003coutput\u003e\n          \u003clang\u003e                 The language of project files: [cpp, java, ruby, python,\n                                   pom]\n          \u003csrc\u003e                  The directory to be analyzed\n          \u003coutput\u003e               The output file name\n          --auto-include         auto include all paths under the source path (please\n                                   notice the potential side effect)\n      -i, --includes=\u003cincludes\u003e[,\u003cincludes\u003e...]\n                                 The files of searching path\n      -d, --dir=\u003cdir\u003e            The output directory\n      -f, --format=\u003cformat\u003e[,\u003cformat\u003e...]\n                                 The output format: [json(default),xml,excel,dot,\n                                   plantuml]\n      -g, --granularity=\u003cgranularity\u003e\n                                 Granularity of dependency.[file(default),method,L#(the level of folder. e.g. L1=1st level folder)  ]\n      -h, --help                 Display this help and exit\n      -s, --strip-leading-path   Strip the leading path.\n      \n      -m, --n-map-files          Output DV8 dependency map file.\n      -p, --namepattern=\u003cnamePathPattern\u003e\n                                 The name path separators.[default(/),dot(.)\n\n\nTo run *Depends*, you need to specify 3 most important parameters: ```lang```, ```src```,```output```, as explained above. \n\n## Remember to specify include paths\n\nPlease note that for most programming languages, such as ```C/C++, Ruby, Maven/Gradle```, the ```--includes``` path is important for *Depends* to find the right files when conducting code dependency analysis, similar to Makefile/IDE.  Otherwise, the extracted dependencies may not be accurate. \n\nDo not specify include paths outside of src directory (e.g. system level include paths, or external dependencies) because *Depends* will not process them.\n\n```--auto-include``` is a useful parameter to simplify the input of include dirs: with this parameter, *Depends* will include all sub-directories of ```src```.\n\nFor ```Java``` programs, you are not required to specify include paths, because the mapping between java file paths are explicitly stated in the import statements.\n\n### Output\n\nThe output of *Depends* can be exported into 5 formats: json, xml, excel, dot, and plantuml. Due to the limitation of MS excel,  you can only export into an excel file if the number of elements is less than 256.)\n\nDot files could be used to generate graphs using GraphViz (http://graphviz.org/).\n\nPlantuml files could be used to generate UML diagram using PlantUML (http://plantuml.com/).\n\nJson and XML files could be used to generate Design Structure Matrices (DSMs) using DV8 (https://www.archdia.net).\n\nThe detail of json/xml format could be found [here](./doc/output_format.md).\n\n### How many dependency types does *Depends* support?\n\n*Depends* supports major dependency types, including:\n* Call: function/method invoke\n* Cast: type cast\n* Contain: variable/field definition\n* Create: create an instance of a certain type\n* Extend: parent-child relation\n* Implement: implemented interface\n* Import/Include: for example, java ```import```, c/c++ ```#include```, ruby ```require```.\n* Mixin: mix-in relation, for example ruby include\n* Parameter: as a parameter of a method\n* Return: returned type\n* Throw: throw exceptions\n* Use: use or set variables\n* ImplLink: the implementation link between call and the implementation of prototype.\n\nFor detail of supported types, please refer to [here](./doc/dependency_types.md)\n\n# How to contribute\n\nThere are many ways to contribute to *Depends*. For example:\n\n## Support new languages\n\n*Depends* implemented a graceful kernel for dependency analysis, which can be extended to accommodate various programming languages. So far, it only supports Java, C/C++, Ruby, and Maven. Please feel free to leverage this framework to add your own dependency extractor. \n\nThe effort needed for each language varies a lot. We spent 24 hours to support Maven, but spent weeks to extract dependencies from Ruby\n\n## Enhance language features and fix issues\n\nParsing source files is not trivial. There are many language-specific features that need to be taken into consideration. Reporting unsupported language features or fixing existing issues will make *Depends* better. \n\n## Create useful tools\n\nYou could use *Depends* as building blocks to create various tools, either open source or commercial, for productions or research, such as GUI tools, code visualization tools, etc.\n\n## Become a sponsor\n\nIt will help us a great deal if your company or institute becomes a sponsor of our project. Your donation could help *Depends* to be independent, sustainable, and support more contributors.\n\n# Tell us your thoughts\n\nYou are welcome to use \"Depends\" in your projects, either open source or commercial ones, as well as software engineering research. Your feedback is highly appreciated.  We will also be thankful if you could help us spread the words and encourage more people to use it.\n\n# Acknowledgement\n\nThis project is built upon the excellent work of other researchers, including the ENRE framework (https://github.com/jinwuxia/ENRE) proposed by Jin Wuxia et al., and the architecture research from Prof. Yuanfang Cai 's team (https://www.cs.drexel.edu/~yfcai/) on dependency analysis.\n\nThe language specific front-end of *Depends* is built upon several excellent open source projects, including Antlr/Antlr Grammar V4 (https://github.com/antlr), Eclipse CDT (www.eclipse.org/cdt), and JRuby(https://github.com/jruby/jruby).\n\n# Authors\n - Gang ZHANG (https://github.com/gangz)\n - Jin Wuxia (https://github.com/jinwuxia)\n\n# Sponsors\n - ArchDia LLC. (www.archdia.com)\n - Emergent Design Inc.(www.emergentdesign.cn)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultilang-depends%2Fdepends","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultilang-depends%2Fdepends","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultilang-depends%2Fdepends/lists"}