Awesome legacy system modernization tools.
Flow:
- target architecture
- analysis
- language parser
- visualize
- relationship
- status
- plan
- tech debt
- tasks
- steps
- migration
- decoupling
- refactor
- guard
- arch guard
sanitizers is the home for Sanitizers: AddressSanitizer, MemorySanitizer, ThreadSanitizer, LeakSanitizer, and more The actual code resides in the LLVM repository. Here we keep extended documentation, bugfixes and some helper code.
Polyglot Code Explorer - Multi-language source code metrics visualization
Output samples:
Tags 2 UML - Generates UML class diagrams, from source code. Command line tool to convert from a Exuberant-ctags tags file to a UML class diagram, through Graphviz DOT, for all object oriented languages supported by ctags
Modeling 是一个基于代码的领域模型生成工具,支持 Java、Cpp、TypeScript、Golang 等语言。Modeling is a tools to analysis different languages by Ctags.
SQLing build domain model from MySQL schema.
[CLOC]
- SCC is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
- SLOCCount the original sloc counter
- cloc, inspired by SLOCCount; implemented in Perl for portability
- gocloc a sloc counter in Go inspired by tokei
- loc rust implementation similar to tokei but often faster
- loccount Go implementation written and maintained by ESR
- ployglot ATS sloc counter
- tokei fast, accurate and written in rust
performance:
Redis https://github.com/antirez/redis/
Program | Runtime |
---|---|
scc | 18.2 ms ± 1.8 ms |
scc (no complexity) | 15.0 ms ± 1.6 ms |
tokei | 26.9 ms ± 5.7 ms |
loc | 47.6 ms ± 23.8 ms |
polyglot | 20.4 ms ± 1.1 ms |
lizard Lizard is an extensible Cyclomatic Complexity Analyzer for many programming languages including C/C++ (doesn't require all the header files or Java imports). Cyclomatic complexity wiki, 循环复杂度 wiki.
DesigniteJava Detects smells and computes metrics of Java code
Coca - Coca is a toolbox which is design for legacy system refactoring and analysis, includes call graph, concept analysis, api tree, design patterns suggest. Coca 是一个用于系统重构、系统迁移和系统分析的瑞士军刀。它可以分析代码中的测试坏味道、模块化分析、行数统计、分析调用与依赖、Git 分析以及自动化重构等。
Usage:
coca analysis
coca arch
Output samples(bs):
{
"dataClass": [
{
"File": "examples/api/BookController.java",
"BS": "dataClass"
}
],
"lazyElement": [
{
"File": "examples/api/model/BookRepresentaion.java",
"BS": "lazyElement"
}
]
}
- https://github.com/facebook/jscodeshift jscodeshift is a toolkit for running codemods over multiple JavaScript or TypeScript files. It provides:
- https://github.com/cpojer/js-codemod js-codemod is a Codemod scripts to transform code to next generation JS.
- Vue-Codemod
- https://github.com/reactjs/react-codemod
- https://github.com/psalaets/vue-jscodeshift-adapter
Benchmarks
Source | Esprima 4.0.1 | UglifyJS2 | Traceur | Acorn 8.0.4 | Shift | Shift (no early errors) |
---|---|---|---|---|---|---|
jQuery.Mobile 1.4.2 | 149.6 ±1.8% | 170.7 ±1.2% | 178.2 ±6.0% | 214.4 ±13.0% | 429.5 ±13.5% | 203.9 ±9.6% |
Angular 1.2.5 | 125.0 ±2.8% | 138.2 ±2.9% | 134.5 ±2.3% | 113.8 ±2.8% | 251.5 ±1.3% | 147.1 ±1.5% |
React 0.13.3 | 127.2 ±1.0% | 158.2 ±1.4% | 160.0 ±0.8% | 128.5 ±2.8% | 310.8 ±2.7% | 182.6 ±2.7% |
Total | 401.8 ms | 467.0 ms | 472.7 ms | 456.7 ms | 991.9 ms | 533.5 ms |
Lemonj - 一个面向 CSS/LESS/SCSS 的分析、坏味道检查和自动化重构工具。
Usage:
npm install lemonj -g
lemonj analysis _fixtures
Output:
Code Smell: {
colors: 24,
importants: 4,
issues: 8,
mediaQueries: 1,
absolute: 0,
oddWidth: 1
}
Code Maat - Code Maat is a command line tool used to mine and analyze data from version-control systems (VCS).
Outputs:
statistic, value
number-of-commits, 919
number-of-entities, 730
number-of-entities-changed, 3397
number-of-authors, 79
git-branches-overview Visualize branches state compared to a base revision or their upstream.
Output:
Coco - An effective DevOps analysis and auto-suggest tool。Coco 是一个研发效能分析工具,如团队发展现状(根据架构复杂度及行数变更)、团队演进、历史分析等。生成可视化报告及对应的改进建议。
Usage:
coco --file-history=true --git-years=3
Output Samples: Coco Nginx Reports
- Z PL/SQL Analyzer The Z PL/SQL Analyzer (or simply ZPA) is a code analyzer for PL/SQL and Oracle SQL code.
- PLSQLParser - A PLSQL parser built using ANTLR 4
Soar 是一个对 SQL 进行优化和改写的自动化工具。 由小米人工智能与云平台的数据库团队开发与维护。
examples:
echo 'select * from film' | ./soar
xo is a Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server
PostgreSQL | MySQL | Oracle | Microsoft SQL Server | SQLite | |
---|---|---|---|---|---|
Models | ✅ | ✅ | ✅ | ✅ | ✅ |
Primary Keys | ✅ | ✅ | ✅ | ✅ | ✅ |
Foreign Keys | ✅ | ✅ | ✅ | ✅ | ✅ |
Indexes | ✅ | ✅ | ✅ | ✅ | ✅ |
Stored Procs | ✅ | ✅ | |||
ENUM types | ✅ | ✅ | |||
Custom types | ✅ |
usql is a universal command-line interface for PostgreSQL, MySQL, Oracle Database, SQLite3, Microsoft SQL Server, and many other databases including NoSQL and non-relational databases!
Usage
# connect to a postgres database
$ usql postgres://booktest@localhost/booktest
# connect to an oracle database
$ usql oracle://user:pass@host/oracle.sid
# connect to a postgres database and run the commands contained in script.sql
$ usql pg://localhost/ -f script.sql
gormt - database to golang struct.
Usage:
Flags:
-d, --database string 数据库名
-f, --foreign 是否导出外键关联
-F, --fun 是否导出函数
-g, --gui 是否ui显示模式
-h, --help help for main
-H, --host string 数据库地址.(注意-H为大写)
-o, --outdir string 输出目录
-p, --password string 密码.
--port int 端口号 (default 3306)
-s, --singular 是否禁用表名复数
-b, --table_names string 表名称
-l, --url string url标签(json,url)
-u, --user string 用户名.
db2struct - db2struct package produces a usable golang struct from a given database table for use in a .go
file.
target: Golang
Usage:
db2struct --host localhost -d example.com -t users --package example --struct user -p --user exampleUser --guregu --gorm
Output
package example
type User struct {
ID int `gorm:"column:id"`
UserName string `gorm:"column:user_name"`
NumberOfLogins null.Int `gorm:"column:number_of_logins"`
LastName null.String `gorm:"column:LAST_NAME"`
}
Doxygen - s the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL and to some extent D.
GoCity - is an implementation of the Code City metaphor for visualizing source code. GoCity represents a Go program as a city, as follows:
- Folders are districts
- Files are buildings
- Structs are represented as buildings on the top of their files.
Toxicity - A rewrite of the original Toxicity chart in Javascript using D3.js
Blast Radius - s is a tool for reasoning about Terraform dependency graphs with interactive visualizations.
Samples:
CodeFlower - Source code visualization utility written in JavaScript with d3.js. Does your code look beautiful?
Output:
Merry is a legacy Java system build migration toolbox, support ant to maven, find lost dep in nexus...
Usage:
go get -u github.com/phodal/merry
merry boom
merry dupsearch
.Net
NetArchTest A fluent API for .Net that can enforce architectural rules in unit tests.
var result = Types.InCurrentDomain()
.That()
.ResideInNamespace("NetArchTest.SampleLibrary.Presentation")
.ShouldNot()
.HaveDependencyOn("NetArchTest.SampleLibrary.Data")
.GetResult()
.IsSuccessful;
Java
ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure. ArchUnit's main focus is to automatically test architecture and coding rules, using any plain Java unit testing framework.
fields().that().haveRawType(Logger.class)
.should().bePrivate()
.andShould().beStatic()
.andShould().beFinal()
.because("we agreed on this convention");
Your contributions are always welcome! Please submit a pull request or create an issue to add a new framework, library or software to the list. Do not submit a project that hasn’t been updated in the past 6 months or is not awesome.