Showing 149 of 200 total issues
Function checkGoogleWTCode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function checkGoogleWTCode($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"
Further reading
Function addSubmenu
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function addSubmenu($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 setMetaInBuffer
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function setMetaInBuffer($buffer) {
global $wp_query;
$this->post = $wp_query->get_queried_object();
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()) {
- 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 checkBingWTCode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function checkBingWTCode($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"
Further reading
Function getBrowserInfo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function getBrowserInfo() {
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version = "";
- 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 sq_getSnippet
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sq_getSnippet(url, show_url) {
if (typeof url == 'undefined')
url = '';
if (typeof sq_blogurl != 'undefined')
url = sq_blogurl;
Method getOtherPluginsMeta
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getOtherPluginsMeta($post_id, $meta = 'title') {
global $wpdb;
$field = '';
$cond = '';
Function dump
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function dump() {
$output = '';
$callee = array('file' => '', 'line' => '');
if (function_exists('func_get_args')) {
$arguments = func_get_args();
- 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 sq_remote_get
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function sq_remote_get($url, $param = array()) {
$cookies = '';
$post_preview = false;
$cookies = array();
$cookie_string = '';
- 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 getAdvancedMeta
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAdvancedMeta($post_id, $meta = 'title') {
global $wpdb;
$field = '';
$cond = '';
Method getOptions
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getOptions() {
$default = array(
'sq_beginner_user' => 1,
'sq_api' => '',
'sq_use' => 0,
Method setHeader
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setHeader() {
global $wp_query;
$ret = '';
$this->post = $wp_query->get_queried_object();
$this->meta['blogname'] = get_bloginfo('name');
Function saveSitemap
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function saveSitemap($data) {
if (function_exists('gzopen') && function_exists('gzwrite') && function_exists('gzclose')) {
if (function_exists('file_exists') && file_exists($this->file . '.gz'))
@unlink($this->file . '.gz');
- 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 packBrief
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function packBrief($response) {
if (!isset($response->seo))
return;
if (isset($response->seo) && ($response->seo->optimized == '0%')) {
- 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 getCustomKeyword
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getCustomKeyword() {
global $wp_query;
$keywords = '';
if ($this->checkPostsPage() && SQ_Tools::$options['sq_auto_description'] == 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 apiCall
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function apiCall($module, $args = array(), $timeout = 60) {
$parameters = "";
if (SQ_Tools::$options['sq_api'] == '' && $module <> 'sq/login' && $module <> 'sq/register')
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 squirrlyLogin
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function squirrlyLogin() {
//set return to null object as default
$return = (object) NULL;
//api responce variable
$responce = '';
- 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 loadMedia
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function loadMedia($uri = '', $media = 'all', $params = null) {
$css_uri = '';
$js_uri = '';
if (isset(self::$cache[$uri]))
- 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 packBrief
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function packBrief($response) {
if (!isset($response->seo))
return;
if (isset($response->seo) && ($response->seo->optimized == '0%')) {
Method getTrafficZone
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTrafficZone() {
$traffic = $this->packTraffic($this->interval);
$str = '';