Showing 96 of 96 total issues
File class-themeisle-ob-wxr-importer.php
has 839 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Author: Andrei Baicus <andrei@themeisle.com>
* Created on: 12/07/2018
*
File class-themeisle-ob-zelle-importer.php
has 659 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Import Zelle to Elementor template.
*
* @package themeisle-onboarding
Function actually_import
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
private function actually_import( $data ) {
global $wp_registered_sidebars;
if ( empty( $data ) || ! is_array( $data ) ) {
return new WP_Error( 'ti__ob_widget_err_1' );
}
- 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 map_our_team_section
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function map_our_team_section() {
if ( isset( $this->previous_theme_content['zerif_ourteam_show'] ) && $this->previous_theme_content['zerif_ourteam_show'] ) {
unset( $this->content[4] );
return;
- 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
File class-themeisle-ob-rest-server.php
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Onboarding Rest Endpoints Handler.
*
* Author: Andrei Baicus <andrei@themeisle.com>
Function parse_post_node
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
protected function parse_post_node( $node ) {
$data = array();
$meta = array();
$comments = array();
$terms = 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
Method process_post
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function process_post( $data, $meta, $comments, $terms ) {
/**
* Pre-process post data.
*
* @param array $data Post data. (Return empty to skip.)
Function process_post
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
protected function process_post( $data, $meta, $comments, $terms ) {
/**
* Pre-process post data.
*
* @param array $data Post data. (Return empty to skip.)
- 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 import
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function import( $file ) {
add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) );
add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
$result = $this->import_start( $file );
- 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 get_sidebar_content
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function get_sidebar_content( $widget_ids, $prefix ) {
if ( empty( $widget_ids ) ) {
return '';
}
$data_in_hestia_format = 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
Themeisle_OB_WXR_Importer
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Themeisle_OB_WXR_Importer extends WP_Importer {
/**
* Maximum supported WXR version
*/
const MAX_WXR_VERSION = 1.2;
Method parse_post_node
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parse_post_node( $node ) {
$data = array();
$meta = array();
$comments = array();
$terms = array();
Function post_process_posts
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function post_process_posts( $todo ) {
foreach ( $todo as $post_id => $_ ) {
$data = array();
$parent_id = get_post_meta( $post_id, '_wxr_import_parent', true );
- 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 import
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import( $file ) {
add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) );
add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
$result = $this->import_start( $file );
Method map_our_team_section
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function map_our_team_section() {
if ( isset( $this->previous_theme_content['zerif_ourteam_show'] ) && $this->previous_theme_content['zerif_ourteam_show'] ) {
unset( $this->content[4] );
return;
Method actually_import
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function actually_import( $data ) {
global $wp_registered_sidebars;
if ( empty( $data ) || ! is_array( $data ) ) {
return new WP_Error( 'ti__ob_widget_err_1' );
}
Method import_remote_xml
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import_remote_xml( WP_REST_Request $request ) {
if ( ! current_user_can( 'manage_options' ) ) {
return new WP_REST_Response(
array(
'data' => 'ti__ob_permission_err_1',
Method register_endpoints
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register_endpoints() {
register_rest_route(
Themeisle_Onboarding::API_ROOT,
'/initialize_sites_library',
array(
Function process_post_meta
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function process_post_meta( $meta, $post_id, $post ) {
if ( empty( $meta ) ) {
return true;
}
- 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 map_testimonials_section
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function map_testimonials_section() {
if ( isset( $this->previous_theme_content['zerif_testimonials_show'] ) && $this->previous_theme_content['zerif_testimonials_show'] ) {
unset( $this->content[5] );
return;
- 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"