Showing 149 of 200 total issues
File SQ_Frontend.php
has 882 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class Model_SQ_Frontend {
/** @var string */
Function __construct
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
function __construct($image, $newfile) {
$ret = "";
$ret.= $this->jpexs_inttoword(0); //PASSWORD
$ret.=$this->jpexs_inttoword(1); //SOURCE
- 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 generateSitemap
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
public function generateSitemap() {
global $wpdb, $wp_query, $wp_version;
/* get the home url */
$home = get_bloginfo('url');
$homeID = 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 grabKeywordsFromPost
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
private function grabKeywordsFromPost($id = null) {
global $wp_query;
$this->max_keywrods = ($this->max_keywrods > 0 ? ($this->max_keywrods - 1) : 0);
if ($this->max_keywrods == 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
File SQ_Menu.php
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class Model_SQ_Menu {
/** @var array with the menu content
Method __construct
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct($image, $newfile) {
$ret = "";
$ret.= $this->jpexs_inttoword(0); //PASSWORD
$ret.=$this->jpexs_inttoword(1); //SOURCE
Model_SQ_Frontend
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class Model_SQ_Frontend {
/** @var string */
private $title;
Function getActions
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function getActions($cur_action) {
/* if config allready in cache */
if (!isset(self::$config)) {
$config_file = _SQ_CORE_DIR_ . 'config.xml';
- 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 getCanonicalUrl
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function getCanonicalUrl() {
global $wp_query;
if (!isset($wp_query) || $wp_query->is_404 || $wp_query->is_search) {
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 checkImage
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
function checkImage($post_id) {
@set_time_limit(90);
$local_file = false;
$content = stripslashes(SQ_Tools::getValue('post_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
Method generateSitemap
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateSitemap() {
global $wpdb, $wp_query, $wp_version;
/* get the home url */
$home = get_bloginfo('url');
$homeID = 0;
Function getBlocks
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function getBlocks($for) {
/* if config allready in cache */
if (!isset(self::$config)) {
$config_file = _SQ_CORE_DIR_ . 'config.xml';
if (!file_exists($config_file))
- 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 progressBar
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
progressBar: new function() {
this.defaults = {
steps: 2, // steps taken to reach target
stepDuration: 2,
Function addFavicon
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function addFavicon($file, $path = ABSPATH) {
$out = array();
$out['name'] = strtolower(basename($file['name']));
$out['tmp'] = _SQ_CACHE_DIR_ . strtolower(basename($file['name']));
$out['favicon'] = $path . "/" . 'favicon.ico';
- 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
File SQ_Tools.php
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Handles the parameters and url
*
Function calcDensity
has a Cognitive Complexity of 33 (exceeds 5 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);
- 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 getCustomDescription
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
private function getCustomDescription() {
global $wp_query;
$sep = '|';
$description = '';
- 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 construct
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.construct = function(arg1, arg2) {
var argvalue = null;
var argconfig = null;
if (arg1 != null) {
File SQ_Menu.php
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
<div id="sq_settings" >
<form id="sq_settings_form" name="settings" action="" method="post" enctype="multipart/form-data">
<div id="sq_settings_title" ><?php _e('Squirrly settings', _PLUGIN_NAME_); ?> <input type="submit" name="sq_update" value="<?php _e('Save settings', _PLUGIN_NAME_) ?> »" /> <a href="post-new.php" id="sq_goto_newpost" <?php echo (($view->options['sq_api'] <> '') ? '' : 'style="display:none"') ?> /><?php _e('Optimize with Squirrly', _PLUGIN_NAME_) ?></a></div>
<div id="sq_settings_body">
File SQ_PostsList.php
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class Model_SQ_PostsList {
/** @var integer */