Showing 149 of 200 total issues
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return 0;
Avoid too many return
statements within this method. Open
return $out;
Avoid too many return
statements within this method. Open
return $link;
Function searchPost
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function searchPost($q, $exclude = array(), $start = 0, $nbr = 8) {
global $wpdb;
$responce = array();
if (sizeof($exclude) > 1) {
$exclude = join(',', $exclude);
- 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 setAdminHooks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setAdminHooks($instance) {
/* for each admin action check if is defined in class and call it */
foreach ($this->admin_hooks as $hook => $value) {
- 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 saveAdvMeta
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function saveAdvMeta($post_id, $metas) {
global $wpdb;
if ((int) $post_id == 0 || !is_array($metas))
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
Function action
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function action() {
parent::action();
switch (SQ_Tools::getValue('action')) {
//login action
case 'sq_settings_affiliate':
- 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 searchPhrase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function searchPhrase($text) {
$words = explode(".", strtolower($text));
//print_r($words);
$frequencies = array();
foreach ($words as $str) {
- 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"