Showing 39 of 43 total issues
Function array_column
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
function array_column($input = null, $columnKey = null, $indexKey = null)
{
// Using func_get_args() in order to check for proper number of
// parameters and trigger errors exactly as the built-in array_column()
// does in PHP 5.5.
- 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
Method form
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
function form( $instance ) {
$defaults = array(
'title' => 'Latest Articles',
'post_type' => 'post',
Function maera_templates_sidebar
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function maera_templates_sidebar() {
global $wp_query;
$templates = array();
- 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 modify_edd_download_shortcode
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function modify_edd_download_shortcode( $display, $atts, $buy_button, $columns, $column_width, $downloads, $excerpt, $full_content, $price, $thumbnails, $query ) {
$button_defaults = apply_filters( 'edd_purchase_link_defaults', array() );
$button_defaults_class = $button_defaults['class'];
- 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
Method maera_templates_hierarchy
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function maera_templates_hierarchy( $templates = array() ) {
if ( ! isset( $templates ) ) {
$templates = array();
}
Function maera_templates_hierarchy
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function maera_templates_hierarchy( $templates = array() ) {
if ( ! isset( $templates ) ) {
$templates = array();
}
- 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 fitVids
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.fitVids = function( options ) {
var settings = {
customSelector: null
};
Method modify_edd_download_shortcode
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modify_edd_download_shortcode( $display, $atts, $buy_button, $columns, $column_width, $downloads, $excerpt, $full_content, $price, $thumbnails, $query ) {
$button_defaults = apply_filters( 'edd_purchase_link_defaults', array() );
$button_defaults_class = $button_defaults['class'];
Method array_column
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function array_column($input = null, $columnKey = null, $indexKey = null)
{
// Using func_get_args() in order to check for proper number of
// parameters and trigger errors exactly as the built-in array_column()
// does in PHP 5.5.
Method replacements
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function replacements() {
$replacements = array(
'maera_grid_container_open',
'maera_grid_container_close',
Method create_settings
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_settings( $controls ) {
global $edd_options;
$controls[] = array(
Method widget
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function widget( $args, $instance ) {
extract( $args );
if ( isset( $instance['term'] ) && 'any' != $instance['term'] ) {
Method add_controls
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_controls( $wp_customize ) {
// Get the available shells and format the array properly
$available_shells = apply_filters( 'maera/shells/available', array() );
$shells = array();
Method modify_edd_download_shortcode
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
function modify_edd_download_shortcode( $display, $atts, $buy_button, $columns, $column_width, $downloads, $excerpt, $full_content, $price, $thumbnails, $query ) {
Method maera_templates_sidebar
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function maera_templates_sidebar() {
global $wp_query;
$templates = array();
Method admin_notice
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function admin_notice() {
global $current_user ;
$user_id = $current_user->ID;
Method colors
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function colors() {
$thumb_id = get_post_thumbnail_id( $this->post_id );
$thumb_url = wp_get_attachment_image_src( $thumb_id );
$thumb_url = $thumb_url[0];
Method grab_points
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function grab_points( $type = 'index' ) {
$img = $this->image_obj;
if ( ! $img )
return false;
Method add_settings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_settings( $wp_customize ) {
$wp_customize->add_setting( 'maera_admin_options[shell]', array(
'default' => 'core',
'type' => 'option',
Method colorposts_build_css
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function colorposts_build_css( $styles ) {
$src = $this->custom_header_url();
if ( $src && get_template_directory_uri() . '/core-shell/assets/images/grid-back.png' != $src ) {