Showing 35 of 44 total issues
File helpers.php
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Timeline Express Helper Functions
* By Code Parrots
*
File class-timeline-express-admin.php
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Timeline Express :: Admin Class
*
* @author Code Parrots
File page.addons.php
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Addon Template - Admin Page
*
* @package Timeline Express
Method timeline_express_add_on_activation
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function timeline_express_add_on_activation() {
if ( ! current_user_can( 'install_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to activate plugins on this site.', 'timeline-express' ) );
Timeline_Express_Admin
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Timeline_Express_Admin {
/**
* Main constructor
*/
public function __construct() {
Method timeline_express_addon_details
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeline_express_addon_details( $data ) {
?>
<div class="plugin-card-bottom">
Method timeline_express_render_addon
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeline_express_render_addon( $addon, $free = false ) {
/**
* Allowed tags for the byline - borrowed from WordPress core.
*
Method timeline_express_build_bootstrap_icon_dropdown
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeline_express_build_bootstrap_icon_dropdown( $field, $meta ) {
$screen = get_current_screen();
$screen_base = $screen->base;
Function edit
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
edit: props => {
const { attributes: { announcementLimit, displayOrder, timeFrame }, className, setAttributes } = props;
return [
Method timeline_express_add_on_installer
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function timeline_express_add_on_installer() {
if ( ! current_user_can( 'install_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to install plugins on this site.', 'timeline-express' ) );
Method timeline_express_get_announcement_image
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeline_express_get_announcement_image( $post_id, $image_size = 'timeline-express' ) {
if ( ! get_post_meta( $post_id, 'announcement_image_id', true ) && ! get_post_meta( $post_id, 'announcement_image', true ) ) {
return;
Method timeline_express_build_addon_data
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeline_express_build_addon_data( $data, $free = false ) {
$all_plugins = get_plugins();
$slug = isset( $data['slug'] ) ? $data['slug'] : sanitize_title( $data['name'] . ' Add-On' );
Method timeline_express_print_inline_styles
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function timeline_express_print_inline_styles( $timeline_express_options ) {
$content_background = ( '' === $timeline_express_options['announcement-bg-color'] ) ? 'transparent' : $timeline_express_options['announcement-bg-color'];
$content_shadow = ( '' === $timeline_express_options['announcement-box-shadow-color'] ) ? '0 3px 0 transparent' : '0 3px 0 ' . $timeline_express_options['announcement-box-shadow-color'];
Method generate_timeline_express
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate_timeline_express( $timeline_express_options, $atts ) {
ob_start();
global $post;
Method timeline_express_get_announcement_icon_markup
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeline_express_get_announcement_icon_markup( $post_id, $link = true ) {
$timeline_express_options = timeline_express_get_options();
$custom_icon_html = apply_filters( 'timeline_express_custom_icon_html', apply_filters( 'timeline-express-custom-icon-html', false, $post_id, $timeline_express_options ), $post_id, $timeline_express_options );
Function timeline_express_build_bootstrap_icon_dropdown
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function timeline_express_build_bootstrap_icon_dropdown( $field, $meta ) {
$screen = get_current_screen();
$screen_base = $screen->base;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function install_plugin
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
cnkt_installer.install_plugin = function( el, plugin ) {
// Confirm activation
var r = confirm( te_installer_localize.install_now );
Method manage_timeline_express_column_content
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function manage_timeline_express_column_content( $column_name, $id ) {
switch ( $column_name ) {
case 'color':
Function te_get_advertisment
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function te_get_advertisment( $part = '' ) {
$advertisment = get_transient( 'timeline_express_ad_transient' );
// Check for a transient before continuing
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function timeline_express_add_on_activation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function timeline_express_add_on_activation() {
if ( ! current_user_can( 'install_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to activate plugins on this site.', 'timeline-express' ) );
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"