File blogger.php
has 854 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Blogger Importer
*
* @package WordPress
Function import_blog
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
function import_blog($blogID) {
global $importing_blog;
$importing_blog = $blogID;
if ( isset($_GET['authors']) )
- 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 show_blogs
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_blogs($iter = 0) {
if ( empty($this->blogs) ) {
$headers = array(
"GET /feeds/default/blogs HTTP/1.0",
"Host: www.blogger.com",
Function show_blogs
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function show_blogs($iter = 0) {
if ( empty($this->blogs) ) {
$headers = array(
"GET /feeds/default/blogs HTTP/1.0",
"Host: www.blogger.com",
- 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_blog
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
function import_blog($blogID) {
global $importing_blog;
$importing_blog = $blogID;
if ( isset($_GET['authors']) )
Blogger_Import
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class Blogger_Import {
// Shows the welcome screen and the magic auth link.
function greet() {
$next_url = get_option('siteurl') . '/wp-admin/index.php?import=blogger&noheader=true';
Function start_element
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function start_element($parser, $name, $attrs) {
$tag = array_pop(split(":", $name));
array_unshift($this->ns_contexts, $this->ns_decls);
- 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_post
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function import_post( $entry ) {
global $importing_blog;
// The old permalink is all Blogger gives us to link comments to their posts.
if ( isset( $entry->draft ) )
Function start
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function start() {
if ( isset($_POST['restart']) )
$this->restart();
$options = get_option('blogger_importer');
- 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 end_element
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function end_element($parser, $name) {
$tag = array_pop(split(":", $name));
if(!empty($this->in_content)) {
- 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_post
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function import_post( $entry ) {
global $importing_blog;
// The old permalink is all Blogger gives us to link comments to their posts.
if ( isset( $entry->draft ) )
- 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 ns_to_prefix
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function ns_to_prefix($qname) {
$components = split(":", $qname);
$name = array_pop($components);
if(!empty($components)) {
- 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_comment
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function import_comment( $entry ) {
global $importing_blog;
// Drop the #fragment and we have the comment's old post permalink.
foreach ( $entry->links as $link ) {
Method start_element
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start_element($parser, $name, $attrs) {
$tag = array_pop(split(":", $name));
array_unshift($this->ns_contexts, $this->ns_decls);
Function import_comment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function import_comment( $entry ) {
global $importing_blog;
// Drop the #fragment and we have the comment's old post permalink.
foreach ( $entry->links as $link ) {
- 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"