• Stars
    star
    260
  • Rank 157,189 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 9 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dead code detection with tombstones for PHP πŸͺ¦πŸ§Ÿ

scheb/tombstone

Implements the concept of tombstones for dead code detection in PHP.

The library provides you with a toolbox to place, track and evaluate tombstones in your code.

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Monthly Downloads Total Downloads License

Logo

What are Tombstones?

To get the basic idea, watch David Schnepper's 5 minute talk from Velocity Santa Clara 2014.

Tombstone Youtube Video

When you want to identify and clean-up dead code in a project, static code analysis tools are the weapon of choice. But these tools have some limitations, especially in a dynamic language like PHP:

  • They can only tell you, if a piece of code is referenced, not if it's actually used
  • They cannot resolve dynamic or generated call paths

Tombstones provide a way to track if a piece of code is actually invoked. They are executable markers in your code, that you can place where you suspect dead code. Then, you collect tombstone invocations on production. After a while, the logs will tell you, which tombstones are dead and which ones aren't (the so called "vampires").

Installation

The library consists of multiple components, that need to be installed and configured independently:

Read how to install scheb/tombstone-logger for placing and logging tombstones in your code.

Read how to install scheb/tombstone-analyzer, which takes log data from scheb/tombstone-logger to generate reports in various formats. For example an HTML report:

Dashboard view Code view

Security

For information about the security policy and know security issues, see SECURITY.md.

Contributing

Want to contribute to this project? See CONTRIBUTING.md.

License

This software is available under the MIT license.

Acknowledgments

The library is heavily inspired by Nestoria.com's implementation of the tombstone concept.

Thanks to Jordi Boggiano for creating Monolog, from where I lend the handler/formatter concept.

The tombstone graphic is based on a licensed illustration by "lemonadeserenade".

Support Me

I'm developing this library since 2015. I love to hear from people using it, giving me the motivation to keep working on my open source projects.

If you want to let me know you're finding it useful, please consider giving it a star ⭐ on GitHub.

If you love my work and want to say thank you, you can help me out for a beer 🍻️ via PayPal.

More Repositories

1

2fa

Two-factor authentication for Symfony applications πŸ”
PHP
500
star
2

two-factor-bundle

[ABANDONED] Two-factor authentication for Symfony 2 & 3 applications πŸ”. Please use the newer versions from https://github.com/scheb/2fa.
PHP
385
star
3

yahoo-finance-api

PHP client for Yahoo Finance API πŸ“ˆ
PHP
278
star
4

sound-to-light-osc

Real-time detection of beats from audio, sending out OSC signals for sound-to-light control πŸŽ΅πŸ’‘
Python
71
star
5

2fa-bundle

[READ ONLY] A generic interface to implement two-factor authentication in Symfony applications
PHP
59
star
6

beer-analytics

Analyzing the composition of beer recipes and visualize results in a human-friendly way πŸ•΅οΈπŸΊ
Python
41
star
7

2fa-trusted-device

[READ ONLY] Extends scheb/2fa-bundle with trusted devices support
PHP
31
star
8

2fa-email

[READ ONLY] Extends scheb/2fa-bundle with two-factor authentication via email
PHP
29
star
9

tombstone-analyzer

[READ ONLY] Report generation for Tombstones created with the scheb/tombstone-logger library
PHP
28
star
10

2fa-google-authenticator

[READ ONLY] Extends scheb/2fa-bundle with two-factor authentication using Google Authenticator
PHP
23
star
11

2fa-totp

[READ ONLY] Extends scheb/2fa-bundle with two-factor authentication using TOTP
PHP
21
star
12

2fa-backup-code

[READ ONLY] Extends scheb/2fa-bundle with backup codes support
PHP
18
star
13

open-apexx

[INACTIVE] ☠️ Open source distribution of apexx CMS
PHP
12
star
14

stock-panel

Symfony application to keep track of your stock portfolio πŸ“ˆ
PHP
11
star
15

2fa-qr-code

[READ ONLY] Extends scheb/2fa-bundle to render QR codes
PHP
9
star
16

in-memory-data-storage

A simple in-memory data storage for PHP
PHP
9
star
17

stock-panel-bundle

[DEPRECATED] Keep track of your stock portfolio
PHP
6
star
18

beer-recipe-analysis

Analyzing the composition of beer brewing recipes with Python and Pandas. It's now a website: www.beer-analytics.com
Jupyter Notebook
3
star
19

phpunit-non-deterministic

How to stub non-deterministic dependencies
PHP
2
star
20

party-projector

Display messages and pictures from party guests on a projector screen
Java
2
star
21

tombstone-logger

[READ ONLY] Tracking of tombstones to find dead code in your codebase
PHP
2
star
22

property-access

Read and write properties from/to PHP objects and arrays
PHP
2
star
23

implementation-iterator

Iterates a PSR-4 compliant directory for implementations of a class/interface
PHP
2
star
24

idea-inspections-checkstyle-converter

[DEPRECATED] Convert IDEA (IntelliJ, PHPStorm) inspection XML format to checkstyle
PHP
2
star
25

two-factor-app

[DEPRECATED] Test application for scheb/two-factor-bundle
PHP
2
star
26

comparator

Answer the question "Are these two equal values?"
PHP
2
star
27

tombstone-core

[READ ONLY] Core classes of the scheb/tombstone library
PHP
2
star
28

qlc-generator

Scripts to generate QLC+ scenes and sequences
PHP
2
star
29

party-projector-app

Android app for scheb/party-projector
Java
1
star
30

mogilefs-stubs

IDE stubs for MogileFS extension
PHP
1
star
31

idea-inspections-core

[DEPRECATED] Core classes to process IDEA inspection files
PHP
1
star