azat-io / todoctor

🐍 CLI tool to track and visualize TODO comments in Git repositories and make report
MIT License
43 stars 0 forks source link
git-analysis source-code-analysis technical-debt todo-comment visualization

Todoctor

Todoctor Logo

Version GitHub License

Todoctor is a powerful tool for analyzing, tracking, and visualizing technical debt in your codebase using Git.

It collects and monitors TODO/FIXME comments in your code, allowing you to observe changes over time.

Why

Developers often leave TODO comments in the code to highlight areas that need improvement or refactoring. However, these comments are rarely converted into tasks in tracking systems.

As a result, todos remain hidden in the codebase and can sit there for years without attention, leading to a hidden backlog of work. This tool tracks these todo comments and prevents them from being forgotten.

Features

Usage

Run the tool in the root directory of your project:

npx todoctor

The program will automatically collect data and display the history of TODO / FIXME comments across commits.

Report

Todos Graph

After running the tool, it generates a detailed graph showing the evolution of TODO comments over time. The graph visualizes how many todo comments were added, resolved, or modified across the project's history.

This helps you track the technical debt and maintenance progress at a glance.

Todoctor Graph Example

Additional Information

In addition to the graph, the tool provides insightful statistics, such as:

These insights help you better understand the state of your codebase and prioritize refactoring efforts.

Todoctor Info Example

List of Todos

Finally, the tool generates a detailed list of all todo comments in your project in a tabular format.

The list includes the comment text, the file path, and additional metadata, such as line numbers and authorship information. This list helps you identify, review, and manage unresolved tasks more effectively.

Todoctor List Example

Options

Todoctor supports the following command-line options:

--month \

Specifies the number of months to include when tracking TODOs in the repository. If not provided, defaults to 3 months.

Example:

todoctor --months 6

--ignore

Allows you to specify files or directories to ignore during the analysis. The files in your .gitignore are ignored by default, you don't need to ignore them additionally. This option can be used multiple times.

Example:

todoctor --ignore src/deprecated/ --ignore tests/legacy.test.js

--include-keywords

Allows you to specify additional keywords in comments that will be treated as technical debt. This option can be used multiple times.

Example:

todoctor --include-keywords eslint-disable-next-line

--exclude-keywords

Allows you to exclude keywords from the report. By default, the following keywords are used to define the technical debt comment:

Example:

todoctor --exclude-keywords WARNING --exclude-keywords DEPRECATED

--output

You can define the folder where the report file will be saved. By default it is todoctor folder in the project root.

Example:

todoctor --output report

--help

Displays this help message with available options.

--version

Displays the current version of Todoctor.

License

MIT © Azat S.