Finding unused Django code to remove

后端 未结 2 1572
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-28 14:15

I\'ve started working on a project with loads of unused legacy code in it. I was wondering if it might be possible to use a tool like coverage in combination with a crawler

相关标签:
2条回答
  • 2020-12-28 14:59

    pylint is great tool for static code analysis (among others things it will detect unused imports, variables or arguments).

    • http://nedbatchelder.com/blog/200806/pylint.html
    • http://www.doughellmann.com/articles/pythonmagazine/completely-different/2008-03-linters/index.html
    0 讨论(0)
  • 2020-12-28 15:12

    You can run the development server under coverage if you use the --noreload switch:

    coverage run ./manage.py runserver --noreload
    
    0 讨论(0)
提交回复
热议问题