Skip to content

TechDebt-Tracker πŸ”Ž Help keep your codebase clean, maintainable, and bug-free! 🧹

License

Notifications You must be signed in to change notification settings

Forward-Lang/TechDebt-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ TechDebt-Tracker πŸš€

TechDebt-Tracker is a powerful command-line tool that helps developers track and manage technical debt in their codebases. It calculates key code metrics like Cyclomatic Complexity, KLOC (thousands of lines of code), and many others to help you identify areas of your code that need attention. Whether you're working solo or as part of a team, TechDebt-Tracker gives you the insights you need to maintain a cleaner, more maintainable codebase.

⚑ Don't let technical debt slow you down – track it, manage it, and refactor it!

🌟 Features 🌟

  • πŸ”’ Cyclomatic Complexity: Measures the complexity of your code and identifies the parts that might be hard to maintain or prone to errors.
  • πŸ“ KLOC: Shows the size of your codebase in thousands of lines, helping you estimate the scale of your project.
  • πŸ“‰ Maintainability Index: Provides a numeric value indicating how maintainable your code is. The higher, the better!
  • πŸ” Halstead Complexity Measures: Calculates various software metrics such as volume, difficulty, and effort based on operations in your code.
  • ⚠️ Risk of Errors: Flags areas of code that are more prone to errors due to high complexity.
  • πŸ“ˆ Easy Integration: Integrate easily with CI/CD pipelines to automatically flag code debt and prompt for necessary refactoring.

With TechDebt-Tracker, you'll be able to keep your codebase clean, maintainable, and error-free for the long term! πŸ’ͺ

πŸ”§ Installation πŸ”§

Prerequisites πŸ“‹

  • Rust installed on your system.

Build from Source πŸ”¨

  1. Clone the repository:

    git clone https://github.com/yourusername/TechDebt-Tracker.git
    cd TechDebt-Tracker
  2. Build the project:

    cargo build --release
  3. Run the tool:

    ./target/release/techdebt-tracker --help

Alternatively, you can install TechDebt-Tracker directly from Cargo:

Note

Not yet implemented: TODO

cargo install techdebt-tracker

πŸƒβ€β™‚οΈ Usage

Basic Command πŸ–₯️

Run the tool to analyze a specific directory or file:

techdebt-tracker <path>

Where <path> is the path to the file or directory you want to analyze.

Example πŸ”

techdebt-tracker ./src

This command will analyze the ./src directory and calculate important metrics like Cyclomatic Complexity, KLOC, and more for all files within it. πŸ“Š

Available Arguments βš™οΈ

  • path: Required. The path to the source code files or directory you want to analyze.

Example Output πŸ’‘

Analyzing path: ./src

Cyclomatic Complexity: 15
KLOC (thousands of lines): 2.1
Maintainability Index: 68
Halstead Volume: 1100
Halstead Difficulty: 35
Halstead Effort: 38500
Risk of Errors: High (complex code detected)

πŸ€– CI/CD Integration

TechDebt-Tracker is perfect for integrating into your CI/CD pipeline to ensure that technical debt is automatically tracked over time. Here's an example using GitHub Actions:

Example GitHub Actions Workflow βš™οΈ

name: Analyze Code Metrics

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  analysis:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Install Rust
      uses: actions/setup-rust@v1
      with:
        rust-version: 'stable'

    # Not yet implemented: TODO
    - name: Build and run TechDebt-Tracker
      run: |
        cargo install --path .
        techdebt-tracker ./src

This will automatically run TechDebt-Tracker every time changes are pushed or a pull request is made to the main branch, ensuring code quality is always monitored. πŸš€

πŸ§‘β€πŸ€β€πŸ§‘ Contributing

We would love your help in making TechDebt-Tracker even better! Whether you have a bug fix, a feature idea, or just want to improve the documentation, your contributions are always welcome. 🌟

How to Contribute πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

  1. Fork the repository 🍴
  2. Create a new branch (git checkout -b feature-name) 🌱
  3. Make your changes ✏️
  4. Commit your changes (git commit -am 'Add new feature') πŸ“
  5. Push to your branch (git push origin feature-name) πŸš€
  6. Open a Pull Request to the main branch πŸ”„

By contributing, you're helping others build cleaner, more maintainable code and fostering a healthy developer ecosystem. 🀝

πŸ“ License

This project is licensed under the MIT License. See the LICENSE file for details. βš–οΈ

πŸ’– Acknowledgments

A huge thanks to the following libraries and projects that helped make TechDebt-Tracker possible:

  • Clap: For building the amazing command-line interface. πŸ–₯️
  • Syn: For parsing Rust code and extracting valuable metrics. πŸ“Š

✨ TechDebt-Tracker – Track your tech debt before it tracks you! ✨