Showing 149 of 200 total issues
Function getRanks
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
getRanks: function(posts) {
jQuery.getJSON(
sqQuery.ajaxurl,
{
action: 'sq_posts_rank',
Consider simplifying this complex logical expression. Open
if (is_home() || (isset($wp_query->query) && empty($wp_query->query)) || is_single() || is_preview() || is_page() || is_archive() || is_author() || is_category() || is_tag() || is_search()) {
$title = $this->getCustomTitle();
if (isset($title) && !empty($title) && $title <> '') {
$buffer = @preg_replace('/<title[^<>]*>([^<>]*)<\/title>/si', sprintf("<title>%s</title>", $title), $buffer, 1, $count);
Consider simplifying this complex logical expression. Open
if (is_home() || (isset($wp_query->query) && empty($wp_query->query)) || is_single() || is_preview() || is_page() || is_archive() || is_category() || is_author() || is_tag() || is_search()) {
/* Meta setting */
$this->title = $this->clearTitle($this->getCustomTitle());
File SQ_Ranking.php
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Class for Google Ranking Record
*/
Function getOtherKeywords
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getOtherKeywords($post_id) {
global $wpdb;
$other_keywords = array();
$sql = "SELECT count(kw.`keyword`) as searched, kw.`keyword`
FROM `" . $this->keyword_table . "` kw
- 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 loadBrief
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadBrief: function(post_id) {
if (jQuery('#sq_post-' + post_id).length == 0) {
jQuery('#post-' + post_id).after('<tr id="sq_post-' + post_id + '" style="display:none"><td colspan="' + (jQuery('#post-' + post_id + ' td').length + 1) + '" class="sq_post_rank_row"><div class="sq_post_rank_title">' + __sq_article_rank + '</div><div class="sq_post_rank_content sq_loading"></div><div class="sq_post_arrow_details"></div><div class="sq_post_rank_close">x</div><div class="sq_post_rank_refresh">' + __sq_refresh + '</div></td></tr>');
} else {
File SQ_Sitemap.php
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Class for Sitemap Generator
*/
Method getCustomTitle
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCustomTitle() {
global $wp_query;
$count = 0;
$title = '';
$optitle = '';
Method checkImage
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkImage($post_id) {
@set_time_limit(90);
$local_file = false;
$content = stripslashes(SQ_Tools::getValue('post_content'));
Method calcDensity
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function calcDensity($text, $title = '', $description = '') {
$keywords = array();
$text = $title . '. ' . $text;
$text = @preg_replace('/[^a-zA-Z0-9-.]/', ' ', $text);
$title = explode(" ", $title);
Method saveVisit
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function saveVisit() {
global $wpdb, $wp_query;
$post_id = 0;
$home = 0;
$sql = '';
Function hookMenu
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function hookMenu() {
$this->upgradeRedirect();
$first_page = preg_replace('/\s/', '_', _SQ_NAME_);
SQ_Tools::checkErrorSettings(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 getAdvancedMeta
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getAdvancedMeta($post_id, $meta = 'title') {
global $wpdb;
$field = '';
$cond = '';
- 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 packBriefProgress
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function packBriefProgress($history) {
if (!is_array($history) || count($history) == 0)
return false;
- 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 resizeImage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function resizeImage($maxwidth, $maxheight, $preserveAspect = true) {
$width = @imagesx($this->imgH);
$height = @imagesy($this->imgH);
if ($width > $maxwidth && $height > $maxheight) {
- 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 getOtherPluginsMeta
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getOtherPluginsMeta($post_id, $meta = 'title') {
global $wpdb;
$field = '';
$cond = '';
- 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 getBrowserInfo
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getBrowserInfo() {
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version = "";
Function addMenu
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function addMenu($param = null) {
if ($param)
$this->menu = $param;
if (is_array($this->menu)) {
- 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 checkGoogleAnalyticsCode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function checkGoogleAnalyticsCode($code) {
//echo $code;
if ($code <> '') {
if (strpos($code, '_gaq.push') !== false) {
preg_match('/_gaq.push\(\[[\'\"]_setAccount[\'\"],\\s?[\'\"]([^\'\"]+)[\'\"]\]\)/i', $code, $result);
- 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 checkFavebookInsightsCode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function checkFavebookInsightsCode($code) {
if ($code <> '') {
if (strpos($code, 'content') !== false) {
preg_match('/content\\s*=\\s*[\'\"]([^\'\"]+)[\'\"]/i', $code, $result);
if (isset($result[1]) && !empty($result[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"