for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
<?php
/**
* Module Name: Keyring
* Module Description: Connections to WPCOM (TODO)
This check looks TODO comments that have been left in the code.
TODO
``TODO``s show that something is left unfinished and should be attended to.
* Sort Order: 10
* Recommendation Order: 7
* First Introduced: 6.5.0
* Requires Connection: Yes
* Auto Activate: Yes
* Module Tags: Recommended
* Feature: General
* Additional Search Queries: connections
*/
class Jetpack_Keyring {
public $in_jetpack = true;
function __construct() {
$this->in_jetpack = ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'enable_module_configurable' ) ) ? true : false;
// investigate what this for
if ( $this->in_jetpack && method_exists( 'Jetpack', 'module_configuration_load' ) ) {
Jetpack::enable_module_configurable( __FILE__ );
Jetpack::module_configuration_load( __FILE__, array( $this, 'jetpack_configuration_load' ) );
}
if ( $this->in_jetpack ) {
require_once dirname( __FILE__ ) . '/keyring/keyring-jetpack.php';
new Jetpack_Keyring;
This check looks
TODO
comments that have been left in the code.``TODO``s show that something is left unfinished and should be attended to.