Skip to content

Latest commit

 

History

History
120 lines (78 loc) · 1.65 KB

README.md

File metadata and controls

120 lines (78 loc) · 1.65 KB

Tech-debt

A simple tool to quantify your technical debt

Installation

requirements : python 3

pip install techdebt

Usage

  1. Adding debt annotation

add debt annotations in your project files to mark technical debt:

  • @debt()
  • @debt("debt_type") or
  • @debt("debt_type":"comment")

Let's say you have a python file with some debt :

#@debt("implementation")
def poor_function():
    
    #@debt("implementation": "variable naming")
    bla = 2
    return bla
  1. Project configuration

Adapt the following configuration file and put it in your project folder (cf config_example.yml)

folder:
  included:
    - test_project/subA
    - test_project/subB

  excluded:
    - vendor
    - node_modules
    - var
    - web
    - nbproject
    - public
    - .git
    - __pycache__

extensions:
  - .py
  - .js
  - .md
  - .php

scores:
  api: 5
  implementation: 3
  1. Run
techdebt --conf="path/to/config_file.yml" #default is "techdebt.yml"

Plugins

You may want to have automatic code checkers do some analysis and being included in the final debt score

For now phpstan is the sole plugin available

Update : not yet working

edit configuration with the following:

plugin:
    phpstan:
        function_to_call: ""
        folders: 
            - folder_to_analyse
        scores: 
            - 

adding plugin

you need to code a file plugin with a method which returns scores and then add it to the yarml file

Roadmap

  • adding line file of annotation
  • better reporting
  • tracking debt over time
  • adding estimation range

Testing

pytest -s src/lib.py