Function _format_time
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
protected function _format_time( $the_time ) {
$time_parts = explode( '|', $the_time );
Avoid using undefined variables such as '$date_parts' which will lead to PHP notices.
if ( '00' === $date_parts[2] ) {
Avoid using undefined variables such as '$date_parts' which will lead to PHP notices.
return $date_parts[1] . ' ' . $meridian;
The method _format_time uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$meridian = 'p.m.';
}
Avoid variables with short names like $y. Configured minimum length is 3.
protected function _year_string( $y ) {
The parameter $the_date is not named in camelCase.
function get_the_modified_date_filter( $the_date, $d = '' ) {
if ( self::AP_STYLE !== $d ) {
return $the_date;
}
Avoid variables with short names like $d. Configured minimum length is 3.
function get_the_modified_date_filter( $the_date, $d = '' ) {
The parameter $the_time is not named in camelCase.
function get_the_modified_time_filter( $the_time, $d = '' ) {
if ( self::AP_STYLE !== $d ) {
return $the_time;
}
The parameter $the_date is not named in camelCase.
public function get_the_date_filter( $the_date, $d = '', $post = null ) {
if ( self::AP_STYLE !== $d ) {
return $the_date;
}
Avoid variables with short names like $m. Configured minimum length is 3.
protected function _month_string( $m ) {
The parameter $the_time is not named in camelCase.
protected function _format_time( $the_time ) {
$time_parts = explode( '|', $the_time );
Avoid variables with short names like $d. Configured minimum length is 3.
public function get_the_time_filter( $the_time, $d = '', $post = null ) {
The class Ap_Style is not named in CamelCase.
class Ap_Style implements Plugin_Interface
{
/**
* Format Strings
The parameter $the_date is not named in camelCase.
protected function _format_date( $the_date ) {
$date_parts = explode( '|', $the_date );
$month = $this->_month_string( $date_parts[1] );
The parameter $the_time is not named in camelCase.
public function get_the_time_filter( $the_time, $d = '', $post = null ) {
if ( self::AP_STYLE !== $d ) {
return $the_time;
}
The parameter $the_value is not named in camelCase.
protected function _capitalization( $the_value ) {
if ( ( ( 'noon' === $the_value || 'midnight' === $the_value ) && self::CAPITALIZE_NOON ) || ( 'today' === $the_value && self::CAPITALIZE_TODAY ) ) {
return ucfirst( $the_value );
}
Avoid variables with short names like $d. Configured minimum length is 3.
public function get_the_date_filter( $the_date, $d = '', $post = null ) {
Avoid variables with short names like $d. Configured minimum length is 3.
function get_the_modified_time_filter( $the_time, $d = '' ) {
The method get_the_time_filter is not named in camelCase.
public function get_the_time_filter( $the_time, $d = '', $post = null ) {
if ( self::AP_STYLE !== $d ) {
return $the_time;
}
The method _year_string is not named in camelCase.
protected function _year_string( $y ) {
if ( date( 'Y' ) !== $y || self::USE_YEAR ) {
return $y;
}
The method _format_time is not named in camelCase.
protected function _format_time( $the_time ) {
$time_parts = explode( '|', $the_time );
The method _month_string is not named in camelCase.
protected function _month_string( $m ) {
$ap_months = [
'01' => 'Jan.',
'02' => 'Feb.',
'03' => 'March',
The method _format_date is not named in camelCase.
protected function _format_date( $the_date ) {
$date_parts = explode( '|', $the_date );
$month = $this->_month_string( $date_parts[1] );
The method get_the_date_filter is not named in camelCase.
public function get_the_date_filter( $the_date, $d = '', $post = null ) {
if ( self::AP_STYLE !== $d ) {
return $the_date;
}
The method get_the_modified_date_filter is not named in camelCase.
function get_the_modified_date_filter( $the_date, $d = '' ) {
if ( self::AP_STYLE !== $d ) {
return $the_date;
}
The method get_the_modified_time_filter is not named in camelCase.
function get_the_modified_time_filter( $the_time, $d = '' ) {
if ( self::AP_STYLE !== $d ) {
return $the_time;
}
The method _capitalization is not named in camelCase.
protected function _capitalization( $the_value ) {
if ( ( ( 'noon' === $the_value || 'midnight' === $the_value ) && self::CAPITALIZE_NOON ) || ( 'today' === $the_value && self::CAPITALIZE_TODAY ) ) {
return ucfirst( $the_value );
}
There are no issues that match your filters.