Giter Club home page Giter Club logo

phpdebt's Introduction

phpdebt

PHP Technical Debt Calculator

It scans through your code looking for any faults based on a number of standards from existing code analysis tools, it totals up the number of faults it finds and compares them against the total lines of functional code (comments and whitespace are excluded) and gives a quality score.

Currently works primarly against Drupal

Installation

Composer

composer global require smmccabe/phpdebt

Git

You will need to manually install the below requirements if you don't wish to use composer.

git clone https://github.com/smmccabe/phpdebt.git
cd phpdebt
./phpdebt

Requirements

Usage and Examples

Against a whole project

phpdebt .

Against a specific folder

phpdebt src/

Against a specific file

phpdebt src/MyClass.php

Against wildcards

phpdebt src/*.inc

Sample output

phpdebt .
phpmd cleancode: 145
phpmd codesize: 19
phpmd design: 2
phpmd naming: 35
phpmd unusedcode: 43
phpcs Drupal: 39
phpcs DrupalPractice: 69
Total Faults: 352
Total Lines: 10568
Quality Score: 3 faults per 100 lines

Score Guidelines

Faults per 100 lines:

  • < 2 - Excellent Code
  • < 6 - Good Code
  • < 10 - Decent Code
  • < 25 - Needs work, cleanup should be prioritized of most feature work
  • >= 25 Needs significant work, cleanup should be prioritized over any feature work or bugfixes.

Fixing Found Faults

phpdebt does not currently provide a verbose mode, to identify and fix specific faults, it is recommended to run tools such as phpmd and phpcs directly, see the phpdebt script if you wish to replicate what phpdebt is running. A verbose mode will be added in the future.

Bugs or Issues

Please post any bugs, issues or support requests to the github issue board

phpdebt's People

Contributors

smmccabe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.