Showing 149 of 200 total issues
Method getSERPZone
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSERPZone($serp) {
$str = '';
$str .= '<ul class="sq_rank_ul_values">
<li class="sq_rank_values">
<table>
Method packStatus
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function packStatus($progress) {
$str = '';
//Check show conditions
if (!$this->showPopup($progress))
return;
Method dump
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function dump() {
$output = '';
$callee = array('file' => '', 'line' => '');
if (function_exists('func_get_args')) {
$arguments = func_get_args();
Function getGoogleRank
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function getGoogleRank($post_id = 0, $keyword = "", $country = "com", $language = "en") {
global $wpdb;
$this->keyword = $keyword;
$keyword = str_replace(" ", "+", urlencode(strtolower($keyword)));
- 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 processRanking
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function processRanking(&$return, $post_id) {
if (isset($return->seo) && is_object($return->seo)) {
$return->global_rank = $this->findTodayRank($post_id, 'global_rank');
$saved_keyword = $this->findTodayRank($post_id, 'keyword');
- 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 checkDebug
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function checkDebug() {
//if debug is called
if (self::getIsset('sq_debug')) {
- 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 hookInit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function hookInit() {
$browser = SQ_Tools::getBrowserInfo();
if ($browser['name'] == 'IE' && (int) $browser['version'] < 9 && (int) $browser['version'] > 0)
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
Method resizeImage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resizeImage($maxwidth, $maxheight, $preserveAspect = true) {
$width = @imagesx($this->imgH);
$height = @imagesy($this->imgH);
if ($width > $maxwidth && $height > $maxheight) {
Method getGoogleExtension
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getGoogleExtension($language) {
switch ($language) {
case 'en':
$country = '';
break;
Method getRank
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRank($post_id = "") {
global $wpdb;
//Check if ranks is saved in database
$sql = "SELECT analytics.`id`,analytics.`indexed`,analytics.`global_rank`,analytics.`local_rank`, analytics.`keyword`,analytics.`other_keywords`,analytics.`date`
Method sq_remote_get
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function sq_remote_get($url, $param = array()) {
$cookies = '';
$post_preview = false;
$cookies = array();
$cookie_string = '';
Method getGoogleRank
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getGoogleRank($post_id = 0, $keyword = "", $country = "com", $language = "en") {
global $wpdb;
$this->keyword = $keyword;
$keyword = str_replace(" ", "+", urlencode(strtolower($keyword)));
Method add_row
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_row($column, $post_id) {
$title = '';
$description = '';
$frontend = null;
$cached = false;
Method getAverage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAverage($interval = null, $post_id = 0) {
global $wpdb;
$average = array('count' => 0, 'unique' => 0, 'old' => 0);
$days = 0;
Consider simplifying this complex logical expression. Open
if (get_query_var('m')) {
$m = @preg_replace('/[^0-9]/', '', get_query_var('m'));
switch (strlen($m)) {
case 4:
$link = get_year_link($m);
Function hookSavePost
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function hookSavePost($post_id) {
$file_name = false;
// unhook this function so it doesn't loop infinitely
- 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 grabTitleFromPost
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function grabTitleFromPost($id = null) {
global $wp_query;
$post = null;
$title = '';
$advtitle = '';
- 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 action
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function action() {
$start = 0;
$nbr = 8;
$exclude = 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 getUniqueKeywords
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getUniqueKeywords($keywords) {
$all = array();
if (is_array($keywords))
foreach ($keywords as $word) {
if (function_exists('mb_strtolower'))
- 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 checkAdvMeta
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function checkAdvMeta($post_id) {
$meta = array();
if (SQ_Tools::getIsset('sq_fp_title') || SQ_Tools::getIsset('sq_fp_description') || SQ_Tools::getIsset('sq_fp_keywords')) {
if (SQ_Tools::getIsset('sq_fp_title'))
$meta[] = array('key' => 'sq_fp_title',
- 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"