Web.Admin/2014/wordpress/wp-admin/import/greymatter.php
Function import
has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
Open
function import() {
global $wpdb;
$wpvarstoreset = array('gmpath', 'archivespath', 'lastentry');
for ($i=0; $i<count($wpvarstoreset); $i += 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
Method import
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function import() {
global $wpdb;
$wpvarstoreset = array('gmpath', 'archivespath', 'lastentry');
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
File greymatter.php
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* GreyMatter Importer
*
* @package WordPress
Method greet
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function greet() {
$this->header();
?>
<p><?php _e('This is a basic GreyMatter to WordPress import script.') ?></p>
<p><?php _e('What it does:') ?></p>
Avoid deeply nested control flow statements. Open
Open
if (($commentinfo[11]=="PM") && ($commenthour!="12"))
$commenthour=$commenthour+12;
Avoid deeply nested control flow statements. Open
Open
if ($i<10000) {
$entryfile .= "0";
if ($i<1000) {
$entryfile .= "0";
if ($i<100) {
Avoid deeply nested control flow statements. Open
Open
if (!comment_exists($comment_author, $comment_date)) {
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_approved');
$commentdata = wp_filter_comment($commentdata);
wp_insert_comment($commentdata);
$numAddedComments++;
Function dispatch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function dispatch() {
if (empty ($_GET['step']))
$step = 0;
else
$step = (int) $_GET['step'];
- 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"